skip to Main Content

How to get ObjectId instead of Timestamp and other information in a List field when querying MongoDB with ASP.NET Core Web API?

My mongodb user collection is of following schema: { _id: ObjectId("6420eb68cd0df40a33b0ead7"), FirstName: 'Ashutosh', LastName: 'Garg', Email: '[email protected]', Password: 'password', Role: 'Tenant', Properties: [ ObjectId("6420eeb8cd0df40a33b0eadb") ] } My User.cs is: using MongoDB.Bson; using MongoDB.Bson.Serialization.Attributes; using MongoDB.Driver; using System.Text.Json.Serialization; namespace webapi.Models {…

VIEW QUESTION

How to create a column in SQL Server that accepts a list of inputs from ASP.NET Core WebAPI – Html

I got this html form with multi selectable checkboxes <div class="check"> <label>Addons:</label> <input type="checkbox" name ="SelectedCheckboxes[]" value="10%off First service visit" id="10%off First service visit"> <label for="10%off First service visit">10%off First service visit</label> <input type="checkbox" name="SelectedCheckboxes[]" value="10%off Waterwash" id="10%off Waterwash"> <label…

VIEW QUESTION

How to pass JSON array in body of web api c#

I am trying to capture a JSON array of string from POST Request in web api. [HttpPost] [Route("")] public async Task<IHttpActionResult> CancelItems([FromBody] List<string> items) { //codes } But I am getting null in items. Post Body: { "items":[ "1034908029943809497", "1034908029943809494"…

VIEW QUESTION
Back To Top
Search