public static T FindOrCreate <T>(this IBaseDbContext <T> dbContext, string uid) where T : IBaseDbModel, new() { var data = dbContext.Find(uid); if (data == null) { data = new T { Uid = uid }; dbContext.Add(data); } return(data); }
public static T FindOrCreate <T>(this IBaseDbContext <T> dbContext, string uid) where T : IBaseDbModel, new() { var data = dbContext.Find(uid); if (data == null) { data = new T { Uid = uid }; dbContext.Add(data); } return(data); }