第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

使用servicestack和c#將數(shù)據(jù)發(fā)布到sql server

使用servicestack和c#將數(shù)據(jù)發(fā)布到sql server

C#
拉風(fēng)的咖菲貓 2021-10-23 16:28:39
我剛剛開始學(xué)習(xí) servicestack 和 c#,我需要一些幫助來將數(shù)據(jù)發(fā)布到 sql server。當(dāng)我使用 swagger 進(jìn)行測試時,我得到了 200 響應(yīng),但實際上沒有將任何內(nèi)容插入到數(shù)據(jù)庫中,而且我不確定我哪里出錯了。型號.類型public class Book{    [PrimaryKey]    [AutoIncrement]    public int BookID { get; set; }    public string Author { get; set; }    public string Title { get; set; }    public int NumberOfPages { get; set; }    public int Isbn { get; set; }}管理器界面:namespace ServiceStackServiceLog4NetTemplate.Interfaces.Managers{   public interface IPostBookManager  {    Book CreateBooks();  }}存儲庫接口:namespace ServiceStackServiceLog4NetTemplate.Interfaces.Repositories{   public interface IPostBookRepository   {     Book PostBooks();   }}消息.請求namespace ServiceStackServiceLog4NetTemplate.ServiceModel.Messages{[Route("/PostBooks", Verbs = "POST")]public class PostBooksRequest{    [AutoIncrement]    public int BookID { get; set; }    public string Author { get; set; }    public string Title { get; set; }    public int NumberOfPages { get; set; }    public int Isbn { get; set; }}}消息.響應(yīng)namespace ServiceStackServiceLog4NetTemplate.ServiceModel.Messages{public class PostBooksResponse : IHasResponseStatus{    public Book Book { get; set; }    public ResponseStatus ResponseStatus { get; set; }}}經(jīng)理    class PostBooksManager : IPostBookManager    {    private IPostBookRepository postRepo;    public PostBooksManager(IPostBookRepository pRepo)    {        postRepo = pRepo;    }    public Book CreateBooks()    {        var bookCreations = postRepo.PostBooks();        return bookCreations;    }}}
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 210 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號