Beispiel #1
0
 public Pet(string nome, StatusPet status, Categoria categoria, List <Tag> tags)
 {
     this.Tags      = tags;
     this.Nome      = nome;
     this.Status    = status;
     this.Categoria = categoria;
 }
Beispiel #2
0
        private static StatusPet CreateStatusPetIfNotExists(ProyectoPrograWebContext dbcontext, int Id, string descripcion)
        {
            var obj = dbcontext.StatusPets.Where(x => x.IdStatus == Id);

            if (!obj.Any())
            {
                StatusPet o = new StatusPet()
                {
                    NameStatus = descripcion
                };

                dbcontext.StatusPets.Add(o);
                dbcontext.SaveChanges();

                return(o);
            }

            return(null);
        }