entity-framework-core-3.1

Ambiguous call when using LINQ extension method on DbSet<T>

北战南征 提交于 2020-12-30 05:13:29
问题 I am using a LINQ query on a DbSet<T> : await _dbContext.Users.AnyAsync(u => u.Name == name); However, the compiler outputs the following error: Error CS0121: The call is ambiguous between the following methods or properties: 'System.Linq.AsyncEnumerable.AnyAsync<TSource>(System.Collections.Generic.IAsyncEnumerable<TSource>, System.Func<TSource, bool>)' and 'Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.AnyAsync<TSource>(System.Linq.IQueryable<TSource>, System.Linq

Ambiguous call when using LINQ extension method on DbSet<T>

被刻印的时光 ゝ 提交于 2020-12-30 05:13:27
问题 I am using a LINQ query on a DbSet<T> : await _dbContext.Users.AnyAsync(u => u.Name == name); However, the compiler outputs the following error: Error CS0121: The call is ambiguous between the following methods or properties: 'System.Linq.AsyncEnumerable.AnyAsync<TSource>(System.Collections.Generic.IAsyncEnumerable<TSource>, System.Func<TSource, bool>)' and 'Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.AnyAsync<TSource>(System.Linq.IQueryable<TSource>, System.Linq

Ambiguous call when using LINQ extension method on DbSet<T>

心不动则不痛 提交于 2020-12-30 05:12:28
问题 I am using a LINQ query on a DbSet<T> : await _dbContext.Users.AnyAsync(u => u.Name == name); However, the compiler outputs the following error: Error CS0121: The call is ambiguous between the following methods or properties: 'System.Linq.AsyncEnumerable.AnyAsync<TSource>(System.Collections.Generic.IAsyncEnumerable<TSource>, System.Func<TSource, bool>)' and 'Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.AnyAsync<TSource>(System.Linq.IQueryable<TSource>, System.Linq

Ambiguous call when using LINQ extension method on DbSet<T>

寵の児 提交于 2020-12-30 05:11:30
问题 I am using a LINQ query on a DbSet<T> : await _dbContext.Users.AnyAsync(u => u.Name == name); However, the compiler outputs the following error: Error CS0121: The call is ambiguous between the following methods or properties: 'System.Linq.AsyncEnumerable.AnyAsync<TSource>(System.Collections.Generic.IAsyncEnumerable<TSource>, System.Func<TSource, bool>)' and 'Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.AnyAsync<TSource>(System.Linq.IQueryable<TSource>, System.Linq

Ambiguous call when using LINQ extension method on DbSet<T>

a 夏天 提交于 2020-12-30 05:09:54
问题 I am using a LINQ query on a DbSet<T> : await _dbContext.Users.AnyAsync(u => u.Name == name); However, the compiler outputs the following error: Error CS0121: The call is ambiguous between the following methods or properties: 'System.Linq.AsyncEnumerable.AnyAsync<TSource>(System.Collections.Generic.IAsyncEnumerable<TSource>, System.Func<TSource, bool>)' and 'Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.AnyAsync<TSource>(System.Linq.IQueryable<TSource>, System.Linq

Group join in EF Core 3.1

冷暖自知 提交于 2020-08-19 07:29:29
问题 I am trying to group join in EF core 3.1 the problem it returns Processing of the LINQ expression 'DbSet failed. This may indicate either a bug or a limitation in EF Core my code is like this var employees = await (from enrollment in RepositoryContext.Enrollments join allowance in RepositoryContext.Allowances.Include(y=>y.AllowanceType) on enrollment.EmployeeId equals allowance.EmployeeId into allowances select new { enrollment, allowances } ).AsNoTracking().ToListAsync(); the allowances is

Entity Framework Core 3.1 with NetTopologySuite.Geometries.Point: SqlException: The supplied value is not a valid instance of data type geography

*爱你&永不变心* 提交于 2020-07-09 04:37:27
问题 I have a model that looks like this: public class Facility { [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; set; } public NetTopologySuite.Geometries.Point Location { get; set; } } Test code for adding a Point: var testFacility = new Facility(); testFacility.Location = new NetTopologySuite.Geometries.Point(13.003725d, 55.604870d) { SRID = 3857 }; //Other values tested with the same error error //testFacility.Location = new NetTopologySuite.Geometries.Point(13