示例#1
0
 private domain.Oblast ToDomain(model.Oblast modelObject)
 {
     domain.Oblast domainObject = new domain.Oblast();
     domainObject.Id  = modelObject.ID;
     domainObject.Ime = modelObject.Ime;
     return(domainObject);
 }
示例#2
0
 public domain.Oblast Update(domain.Oblast domainObject)
 {
     using (model.LearnByPracticeDataContext context = CreateContext())
     {
         IQueryable <model.Oblast> query = context.Oblasts.Where(p => p.ID == domainObject.Id);
         model.Oblast modelObject        = query.Single();
         modelObject.Ime = domainObject.Ime;
         context.SubmitChanges();
         domain.Oblast result = ToDomain(modelObject);
         return(result);
     }
 }
示例#3
0
        public domain.Oblast Insert(domain.Oblast domainObject)
        {
            using (model.LearnByPracticeDataContext context = CreateContext())
            {
                model.Oblast modelObject = new model.Oblast();
                modelObject.Ime = domainObject.Ime;
                context.Oblasts.InsertOnSubmit(modelObject);
                context.SubmitChanges();
                domain.Oblast result = ToDomain(modelObject);

                return(result);
            }
        }