public MagicItemStatBlock GetMagicItemByNameSource(string name, string source)
        {
            MagicItemService _magicItemService = new MagicItemService(ConnectionString);
            magic_item       tempMagicItem     = _magicItemService.GetMagicItemByNameSource(name, source);

            return(MapThisToMagicItemStatBlockObject(tempMagicItem));
        }
 public IEnumerable <string> UpdateMagicItem(magic_item magicItem)
 {
     return(base.Update <magic_item>(magicItem));
     //using (IRepository<magic_item> magicItemRepository = CreateRepository<magic_item>())
     //{
     //    IEnumerable<string> rules;
     //    magicItemRepository.Update(MagicItem, out rules);
     //    return rules;
     //}
 }
 public IEnumerable <string> AddMagicItem(magic_item newMagicItem)
 {
     return(base.Add <magic_item>(newMagicItem));
     //using (IRepository<magic_item> magicItemRepository = CreateRepository<magic_item>())
     //{
     //    IEnumerable<string> rules;
     //    magicItemRepository.Add(newMagicItem, out rules);
     //    return rules;
     //}
 }
예제 #4
0
        public IHttpActionResult UpdateMagicItem([FromBody] magic_item magic_item)
        {
            if (magic_item == null)
            {
                return(Ok("Magic Item Empty"));
            }
            if (string.IsNullOrEmpty(magic_item.Group))
            {
                return(Ok("Group Empty"));
            }

            _magicItemService = GetMagicItemService();
            IEnumerable <string> Error = _magicItemService.UpdateMagicItem(magic_item);

            return(Ok(Error));
        }
 private static MagicItemStatBlock MapThisToMagicItemStatBlockObject(magic_item MagicItem)
 {
     return(Mapper.Map <magic_item, MagicItemStatBlock>(MagicItem));
 }