Beispiel #1
0
 public static Category MapCategory(XpoCategory category)
 {
     return(new Category
     {
         id = category.Oid,
         Name = category.Name,
         Description = category.Description,
         newObject = false
     });
 }
Beispiel #2
0
        public static XpoCategory MapCategory(Category category, UnitOfWork uow)
        {
            XpoCategory categoryReturned;

            if (category.newObject)
            {
                categoryReturned = new XpoCategory(uow)
                {
                    Oid = category.id
                };
            }
            else
            {
                categoryReturned = uow.GetObjectByKey <XpoCategory>(category.id);
            }
            categoryReturned.Name        = category.Name;
            categoryReturned.Description = category.Description;
            return(categoryReturned);
        }