/// <summary>
 /// Adds the entity to the specified context, putting it into the Added state such that it will be inserted into the database when SaveChanges is
 /// called.
 /// </summary>
 /// <typeparam name="TEntity">The type of the entity.</typeparam>
 /// <param name="entity">The entity to add.</param>
 /// <param name="context">The context to add the entity to.</param>
 /// <returns>The entity being added.</returns>
 public static TEntity AddTo <TEntity>(this TEntity entity, NutmegContext context)
     where TEntity : class
 {
     context.Set <TEntity>().Add(entity);
     return(entity);
 }
Beispiel #2
0
 public SettingsExcelImporter(NutmegContext context)
 {
     _context = context;
 }