c# - Web Api model binding with file attachments -


i have model named event.

public class event {    public int  id {get; set;}    public string name {get; set;}  } 

and use event in controller action method.

    // post api/events     [httppost]     public createeventresponse post(event request)     {         return new createeventresponse { id = 123 };     } 

enter image description here

this works.

but later need attach file event while saving.

i selecting upload file fiddler, content type changed multipart/form-data;

enter image description here

but time event not binding model binder in controller action.

enter image description here


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

Swift game error message -