Sakura.AspNetCore.Extensions/Sakura.EntityFrameworkCore.FromSqlExtensions/DbContextFromSqlExtensions.cs
/// <summary>
///     Try to add a new query type into the <see cref="DbContext" /> if it not exists yet.
/// </summary>
/// <typeparam name="T">The query type should be adding.</typeparam>
/// <param name="dbContext">The <see cref="DbContext" /> instance.</param>
Try to add a new query type into the  if it not exists yet.
Try to add a new query type into the if it not exists yet .
private static void TryAddQueryType<T>(this DbContext dbContext)
		{
			var model = dbContext.Model.AsModel();
			var type = typeof(T);
			if (model.FindEntityType(type) == null) model.AddQueryType(type);
		}
private static void TryAddQueryType < T > ( this DbContext dbContext ) { var model = dbContext . Model . AsModel ( ) ; var type = typeof ( T ) ; if ( model . FindEntityType ( type ) == null ) model . AddQueryType ( type ) ; }
Try to add a new query type into the  if it not exists yet.
Try to add a new query type into the if it not exists yet .
DbContext
this
dbContext
None
typeparam
The query type should be adding.
The query type should be adding .