Ejemplo n.º 1
0
        public void AddAttribute(DocumentAttribute Attribute)
        {
            using (Model.BiblosDS2010Entities db = new Model.BiblosDS2010Entities(BiblosDSConnectionString))
            {
                Model.Attributes entityAttribute = Attribute.TryToConvertTo <Model.Attributes>(false);

                if (Attribute.Mode != null)
                {
                    entityAttribute.IdMode = Attribute.Mode.IdMode;
                }

                if (Attribute.Archive != null)
                {
                    entityAttribute.IdArchive = Attribute.Archive.IdArchive;
                }

                if (Attribute.AttributeGroup != null)
                {
                    entityAttribute.IdAttributeGroup = Attribute.AttributeGroup.IdAttributeGroup;
                }

                db.AddToAttributes(entityAttribute);
                db.SaveChanges();
            }
        }