public void MakeOrderCategory(Category category)
 {
     // код категорий
 }
 public void Update(Category Category)
 {
     db.Entry(Category).State = EntityState.Modified;
 }
        protected override void OnExecute()
        {
            var client = Session.QueryOver<Client>()
                .Where(c => c.Id == ClientId)
                .Fetch(c => c.ClientSettings).Eager.FutureValue();

            var category = new Category { Id = CategoryId };

            var service = IsServiceOffering ? (Service)new ServiceOffering() : new ServiceRequest();

            service.Title = Title;
            service.Body = Body;
            service.Client = client.Value;
            service.Category = category;
            service.EffectiveDate = EffectiveDate ?? DateTime.Now;
            service.Location = PointFactory.Create(Latitude, Longitude);

            service.ExpiryDate = DateTime.Now.Date.AddDays(90);

            ProcessImange(service);
            OnCreate(service);

            Session.Save(service);

            client.Value.ClientSettings.AdCount++;

            Session.CreateSQLQuery("update Category set AdCount = AdCount + 1 where Id=:id")
                .SetInt32("id", CategoryId)
                .ExecuteUpdate();
        }
 public void Create(Category Category)
 {
     db.DbCategory.Add(Category);
 }