public RS.TextValue CreateResourceAttributeValue(string value, R.Resource resource, RS.ResourceAttributeUsage resourceAttributeUsage) { Contract.Requires(!string.IsNullOrWhiteSpace(value)); RS.TextValue textValue = new RS.TextValue() { Value = value, Resource = resource, ResourceAttributeUsage = resourceAttributeUsage }; using (IUnitOfWork uow = this.GetUnitOfWork()) { IRepository <RS.TextValue> repo = uow.GetRepository <RS.TextValue>(); repo.Put(textValue); uow.Commit(); } return(textValue); }
public List <RS.ResourceAttributeValue> GetValuesByResource(R.Resource resource) { return(ResourceAttributeValueRepro.Query(u => u.Resource.Id == resource.Id).ToList()); }
public RS.FileValue CreateResourceAttributeValue(string name, string extention, string minmetype, byte[] data, bool needConfirmation, R.Resource resource, RS.ResourceAttributeUsage resourceAttributeUsage) { //Contract.Requires(!string.IsNullOrWhiteSpace(value)); RS.FileValue fileValue = new RS.FileValue() { Name = name, Extention = extention, Minmetype = minmetype, Data = data, NeedConfirmation = needConfirmation, Resource = resource, ResourceAttributeUsage = resourceAttributeUsage }; using (IUnitOfWork uow = this.GetUnitOfWork()) { IRepository <RS.FileValue> repo = uow.GetRepository <RS.FileValue>(); repo.Put(fileValue); uow.Commit(); } return(fileValue); }