コード例 #1
0
 public static OathViewModel ToViewModel(this Oath oath)
 {
     return(new OathViewModel
     {
         Name = oath.Name,
         Description = oath.Description,
         Mods = oath.Mods.Select(sm => sm.ToViewModel()).ToList(),
         OathId = oath.Id,
         Author = oath.Player?.ToViewModel()
     });
 }
コード例 #2
0
ファイル: OathController.cs プロジェクト: timchenyx/theroom
        // POST: api/Oath
        public async Task <Oath> Post([FromBody] PostRequest request)
        {
            var service = new OathService();
            var txhash  = await service.Write(request.OathContent);

            Oath oath = new Oath();

            oath.OathContent = request.OathContent;
            oath.TxHash      = txhash;

            return(oath);
        }