Esempio n. 1
0
        public virtual void Insert(params TEntity[] items)
        {
            foreach (var item in items)
            {
                if (item != null)
                {
                    // generate new Id
                    item.GenerateNewIdentity();
                    // check trackable item for create
                    if (item.GetType().GetInterfaces().Contains(typeof(ILogable)))
                    {
                        var logger = (ILogable)item;
                        UpdateLogableItem(logger);
                    }

                    ContentContext.CreateSet <TEntity>().Add(item);
                }
                else
                {
                    //TODO create null error log later
                }
            }
            ContentContext.SaveChanges();
        }
 public void Create(Order order)
 {
     _context.Orders.Add(order);
     _context.SaveChanges();
 }