public void AddOrUpdateAction(ResourceSubType resource) { var entity = _resourceSubTypeRepository.GetByID(resource.Id); if (entity != null) { _resourceSubTypeRepository.Detach(entity); _resourceSubTypeRepository.Update(resource); } else { _resourceSubTypeRepository.Insert(resource); } _resourceSubTypeRepository.Save(); }
public Resource(ResourceType type, ResourceSubType subtype, int offset, int size) { MainRawDataType = type; SubRawDataType = subtype; RawDataOffset = offset; RawDataSize = size; }
public Resource(Stream stream) { BinaryReader br = new BinaryReader(stream); MainRawDataType = (ResourceType)br.ReadInt32(); SubRawDataType = (ResourceSubType)br.ReadInt32(); RawDataSize = br.ReadInt32(); RawDataOffset = br.ReadInt32(); }
public void Post([FromBody] ResourceSubType value) { _resourceSubtypeService.AddOrUpdateAction(value); }