Dapper-Plus
Dapper-Plus copied to clipboard
Sql Server Spatial Support
Hi Guys!
What is the right way to BulkMerge entity that has Point member? E.g. here is the entity class definition:
[Table("Airport")]
public partial class Airport
{
[Key]
[StringLength(4)]
public string FourLetterCode { get; set; }
[Required]
[StringLength(3)]
public string ThreeLetterCode { get; set; }
[Required]
[StringLength(50)]
public string Name { get; set; }
[StringLength(3)]
public string CountryCode { get; set; }
public bool IsDisabled { get; set; }
[Column(TypeName = "datetime")]
public DateTime Timestamp { get; set; }
[Column(TypeName = "geometry")]
public Point Location { get; set; }
public string HotelCompany { get; set; }
public string HotelContact { get; set; }
public string HotelPhone { get; set; }
public string HotelMobile { get; set; }
public string HotelFax { get; set; }
public string HotelEmail { get; set; }
public string HotelRemarks { get; set; }
}
Currently DapperPlus inserts null for the Point type member
Thanks
Hello @yahorsi ,
We will check it. I don't think we currently support the Point
class at this moment but we will try to add the support to it if that's possible.
Best Regards,
Jon
Hello @yahorsi ,
Sorry for the long waiting, it looks that the request got stuck.
We added support to SqlGeometry and SqlGeography today (not release yet).
We wanted to make this request at the same time but we found out that the Point
doesn't seem to be part of the Microsoft.SqlServer.Types
dll.
Is it the System.Drawing.Point
or a custom class of your?
Hello @yahorsi ,
The latest version now better support spatial type.
However, the same question remain about the Point
class.
Hi Guys!
Sorry for the delayed answer. It is definitely from the Drawing :) It is NetTopologySuite.Geometries.Point But give me some time to figure out why we're using it ))
Thanks
Hello @yahorsi ,
Just to let you know that the development of this request is going well.
In our branch, it's currently fully working with Microsoft.Data.SqlClient
dll but partially work with System.Data.SqlClient
dll on .NET Core as SqlBulkCopy
doesn't support Udt Type
on this platform.
We currently only need to fix a performance issue to release the support for Microsoft.Data.SqlClient
. I believe it will probably be done tomorrow.
I will give you more information very soon.
Hello @yahorsi ,
The v3.0.4 has been released.
In this version, we added the support to:
- NetTopologySuite.Geometries.Point
- NetTopologySuite.Geometries.Geometry
More type is coming soon. If there is some type you use than you would want us to prioritize, just let us know ;)
will try it later and let you know if it works
@JonathanMagnan - perhaps worth closing issues where you haven't heard back from users?