public Tag Add(Tag tag) { TagEntity tagEntity = converterFactory.tagEntityConverter.Convert(tag); tagEntity = tagEntityDAO.Add(tagEntity); return(converterFactory.tagConverter.Convert(tagEntity, OnObjectCreation)); }
public Tag Get(int id) { Tag tag = tagCache.Keys.Where(t => t.Id == id).FirstOrDefault(); if (tag == null) { TagEntity tagEntity = tagEntityDAO.Get(id); tag = converterFactory.tagConverter.Convert(tagEntity, OnObjectCreation); } return(tag); }
public TagEntity Convert(Tag tag) { TagEntity tagEntity = daoFactory.TagEntityDAO.Get(tag.Id); if (tagEntity == null) { tagEntity = entityFactory.CreateTagEntity(); } tagEntity.Name = tag.Name; tag.Products.ForEach(product => { ProductTagEntity productTagEntity = GetProductTagEntity(product.Id, tag.Id); if (!tagEntity.ProductTagEntities.Contains(productTagEntity)) { tagEntity.ProductTagEntities.Add(productTagEntity); } }); return(tagEntity); }
public void Modify(TagEntity entity) { throw new NotImplementedException(); }
public TagEntity Add(TagEntity entity) { this.tagEntities.Add(entity); return(entity); }
public void Modify(Tag tag) { TagEntity tagEntity = converterFactory.tagEntityConverter.Convert(tag); tagEntityDAO.Modify(tagEntity); }