Ejemplo n.º 1
0
 public Resultat<Categorie> CreateCategorie(CreateCategorieCommand command)
 {
     return Resultat<Categorie>.SafeExecute<ForumService>(
          result =>
          {
              var categorie = new Categorie { Nom = command.Nom, CreateurId = command.CreateurId, DateCreation = command.DateCreation };
              context.Categories.AddObject(categorie);
              context.SaveChanges();
          });
 }
Ejemplo n.º 2
0
        private void FixupCategorie(Categorie previousValue)
        {
            if (previousValue != null && previousValue.Topics.Contains(this))
            {
                previousValue.Topics.Remove(this);
            }

            if (Categorie != null)
            {
                if (!Categorie.Topics.Contains(this))
                {
                    Categorie.Topics.Add(this);
                }
                if (CategorieId != Categorie.Id)
                {
                    CategorieId = Categorie.Id;
                }
            }
        }