public IHttpActionResult UploadNestedInfo(UploadNestedInfoViewModel info) { if (info == null) { info = new UploadNestedInfoViewModel(); Validate(info); } if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var messages = new List <string>(); var attachment = info.Attachment; messages.Add($"Root attachment information: (Mime) {attachment.MediaType} - (File name) {attachment.Name}"); return(Ok(new ClientResponseViewModel(messages))); }
public IHttpActionResult UploadNestedInfo(UploadNestedInfoViewModel info) { if (info == null) { info = new UploadNestedInfoViewModel(); Validate(info); } if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var messages = new List <string>(); var attachment = info.Attachment; messages.Add($"Root attachment information: (Mime) {attachment.MediaType} - (File name) {attachment.Name}"); var profile = info.Profile; if (profile != null) { messages.Add($"Profile has been uploaded."); messages.Add($"Profile name : {profile.Name}"); var profileAttachment = profile.Attachment; messages.Add( $"Profile attachment information: (Mime) {profileAttachment.MediaType} - (File name) {profileAttachment.Name}"); } else { messages.Add("No profile is added"); } return(Ok(new ClientResponseViewModel(messages))); }