Beispiel #1
0
        public DomainItem GetEntity(DomainItemIdentityModel id)
        {
            if (id == null)
            {
                throw new ArgumentNullException("ID is null");
            }
            var item = itemDB.Get(id);

            if (item == null)
            {
                throw new NullReferenceException(string.Format("No item with id {0} found", id));
            }
            return(item);
        }
Beispiel #2
0
        /*public void Delete(int id)
         * {
         *  DAItem Item = db.Items.Find(id);
         *  if (Item != null)
         *      db.Items.Remove(Item);
         * }*/

        public DomainItem Get(DomainItemIdentityModel id)
        {
            return(mapper.Map <DomainItem>(GetItem(id.ID)));
        }