I'm trying to find an entity but I get a SqlNullValueException when entity framework is trying to get the value of a field that's Null. I checked in the database and all the not nullable fields are filled. The only fields that have a NULL value are the ones that [...] read more
I'm writing a C# application to retrieve recipes from a MySQL database, using Dapper for ORM. So far, I've written my DAL in C# with direct queries (Which I know is unsafe), and this works great. I've now started to transition over to stored procedures with parameters to better protect [...] read more
I'm getting this error on one of my fetch services > System.Data.SqlTypes.SqlNullValueException HResult=0x80131931 > Message=Data is Null. This method or property cannot be called on Null values. > Source=Microsoft.Data.SqlClient StackTrace: at > Microsoft.Data.SqlClient.SqlBuffer.get_Int32() at > Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable1.Enumerator.MoveNext() > at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at > System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at > Infrastructure.Data.Repository.Base.EfRepository1.List(ISpecification1 spec) > in [...] read more
This is driving me crazy: using (var context = new aContext()) { _Paz = context.TPaz .Where(a => a.CodPaz == _PazV.CodPaz) .FirstOrDefault(); } I have 2 different rows, on the first one everything is perfect. On the second one I get the error Here the definitions: [Table("tPAZ")] public partial class TPaz [...] read more