Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ennija 44 posts 126 karma points
    May 10, 2016 @ 06:12
    Ennija
    0

    Webservices

    I need create webservce  i looking in ther 
    

    https://our.umbraco.org/documentation/Reference/Management/Services/ContentService

    [WebMethod]
                public string AddNewsVendor(int parentId, string Datetype, int copyContentParetnId, string copyDateType )
                {
    
                    var service = ContentService;
                    var newVendorPost = service.CreateContentWithIdentity("test", parentId, Datetype);
    
                }
    

    but in ContentService nedds sam parametrs but in example not need parametrs.

    what's wrong?

  • Dennis Adolfi 1082 posts 6450 karma points MVP 6x c-trib
    May 10, 2016 @ 06:15
    Dennis Adolfi
    0

    Hi Ennija.

    Try accessing ContentService directly, and not by creating an instance.

    Like so:

    var newVendorPost = ApplicationContext.Current.Services.ContentService.CreateContentWithIdentity("test", parentId, Datetype);
    

    Best of luck to you!!

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies