private void CreateMovies()
 {
     if (_movies == null) {
         _movies = new FakeDbSet<Movie>();
         _movies.Add(new Movie { ID = 1, Title = "Test Album 1", Genre="Genre 1", Price=8.99M, Rating="R", ReleaseDate=new DateTime(1985, 6, 1)});
         _movies.Add(new Movie { ID = 2, Title = "Test Album 2", Genre = "Genre 2", Price = 8.99M, Rating = "R", ReleaseDate = new DateTime(1985, 6, 1) });
         _movies.Add(new Movie { ID = 3, Title = "Test Album 1", Genre = "Genre 3", Price = 8.99M, Rating = "R", ReleaseDate = new DateTime(1999, 6, 1) });
     }
 }
示例#2
0
 private static void Add2TodoListsAnd3TodoItems(IDbSet<TodoList> todoLists, IDbSet<TodoItem> todoItems)
 {
     foreach (var list in TodoLists)
     {
         todoLists.Add(list);
     }
     foreach (var item in TodoItems)
     {
         todoItems.Add(item);
     }
 }
 public override void Add(T entity)
 {
     _dbset.Add(entity);
     SaveChanges();
 }
示例#4
0
        public Tid Add(Tentity entity)
        {
            var item = _dbset.Add(entity);

            return(item.Id);
        }
示例#5
0
 public virtual void Add(T entity)
 {
     dbset.Add(entity);
 }
示例#6
0
 public virtual void Add(TEntity obj)
 {
     _dbset.Add(obj);
 }
示例#7
0
 public void AddUserMetaDataByUserName(UserMetaData userMetaData, string userName)
 {
     userMetaData.User = _userService.GetUserByUserName(userName);
     _userMetaData.Add(userMetaData);
 }
示例#8
0
 public void InsertModel(T model)
 {
     dbEntity.Add(model);
 }
示例#9
0
 public void Create(T obj)
 {
     dbSet.Add(obj);
     db.SaveChanges();
 }
示例#10
0
 public virtual void Add(TEntity entity)
 {
     dbSet.Add(entity);
 }
示例#11
0
 public TEntity Insert(TEntity entity)
 {
     _dbSet.Add(entity);
     _context.SaveChanges();
     return(entity);
 }
 public void Add(T Entity)
 {
     _dbSet.Add(Entity);
     _dbContext.SaveChanges();
 }
 public void Insert(T obj)
 {
     table.Add(obj);
 }
示例#14
0
 public T Insert(T entity)
 {
     return(dbSet.Add(entity));
 }
示例#15
0
 public virtual T Add(T entity)
 {
     dbset.Add(entity);
     return(entity);
 }
示例#16
0
 public virtual T Add(T entity)
 {
     return(_dbset.Add(entity));
 }
示例#17
0
 public virtual T Add(T entity)
 {
     return(dbSet.Add(entity));
 }
示例#18
0
 /// <summary>
 /// Add an entry
 /// </summary>
 public virtual void Add(TDomainClass instance)
 {
     DbSet.Add(instance);
 }
示例#19
0
 public void Add(T entity)
 {
     _dbSet.Add(entity);
 }
示例#20
0
 public void AddNewProduct(Product product)
 {
     _products.Add(product);
 }