Click here to Skip to main content
15,907,497 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Need to Integrate Swipe Machine in my C# Application for billing Pin
jschell20-Mar-23 6:40
jschell20-Mar-23 6:40 
QuestionUsing the WebControlAdapter class with WinForms and ASP.NET 4.5.2 Pin
WhoPinchedMyName28-Feb-23 7:43
WhoPinchedMyName28-Feb-23 7:43 
QuestionI want to show the first lettter of token to be upercase in my code, but it then show the page name and not the token name Pin
hendrikbez23-Feb-23 0:25
hendrikbez23-Feb-23 0:25 
AnswerRe: I want to show the first lettter of token to be upercase in my code, but it then show the page name and not the token name Pin
hendrikbez26-Feb-23 3:24
hendrikbez26-Feb-23 3:24 
Questionhow to auto print label in vb to be in the database Pin
IsdKirti L&tSou20-Feb-23 0:06
IsdKirti L&tSou20-Feb-23 0:06 
AnswerRe: how to auto print label in vb to be in the database Pin
Richard Deeming20-Feb-23 0:45
mveRichard Deeming20-Feb-23 0:45 
QuestionIs it possible to use OData in local mode? Pin
Alex Wright 202217-Feb-23 21:28
Alex Wright 202217-Feb-23 21:28 
QuestionHow to enable nested json result in OData (ASP.NET Core API) Pin
Alex Wright 202214-Feb-23 20:57
Alex Wright 202214-Feb-23 20:57 
I'm using the following controller to get data from database using EF Core:

C#
public class EquipmentsController : ODataController
    {
        private readonly SqlServerContext _sqlServerContext;

        public EquipmentsController(SqlServerContext sqlServerContext)
        {
            _sqlServerContext = sqlServerContext;
        }

        [HttpGet]
        [EnableQuery]
        public ActionResult<IQueryable<Equipment>> Get()
        {
            IQueryable<Equipment> eqList = _sqlServerContext.Equipments.AsQueryable()
                .Include(x => x.CostCenter)
                .Include(x => x.EquipmentCategory)
                .Include(x => x.equipmentType);

            return Ok(eqList);
        }
    }


My problem is that I cannot get nested result in the final json while I have included CostCenter, EquipmentCategory, and equipmentType entities. I'm using ASP.NET Core 6 API and OData 8.0.12

My ED model is as follows:

static IEdmModel GetEdmModel()
{
    ODataConventionModelBuilder builder = new();
    builder.EntitySet<Equipment>("Equipments");
    return builder.GetEdmModel();
}


How can I fix that?
AnswerRe: How to enable nested json result in OData (ASP.NET Core API) Pin
Richard Deeming14-Feb-23 22:11
mveRichard Deeming14-Feb-23 22:11 
GeneralRe: How to enable nested json result in OData (ASP.NET Core API) Pin
Alex Wright 202214-Feb-23 22:33
Alex Wright 202214-Feb-23 22:33 
Question(SOLVED) Having problem showing just a section of a page. Pin
samflex16-Jan-23 10:40
samflex16-Jan-23 10:40 
SuggestionRe: Having problem showing just a section of a page. Pin
Richard Deeming16-Jan-23 22:11
mveRichard Deeming16-Jan-23 22:11 
GeneralRe: Having problem showing just a section of a page. Pin
samflex17-Jan-23 6:21
samflex17-Jan-23 6:21 
QuestionASP.NET core web api Pin
tixzre28-Dec-22 7:15
tixzre28-Dec-22 7:15 
AnswerRe: ASP.NET core web api Pin
tixzre29-Dec-22 5:41
tixzre29-Dec-22 5:41 
GeneralRe: ASP.NET core web api Pin
Richard Deeming5-Jan-23 0:28
mveRichard Deeming5-Jan-23 0:28 
QuestionStore Rich Text in DATA Base Pin
CARBER25-Nov-22 22:05
CARBER25-Nov-22 22:05 
AnswerRe: Store Rich Text in DATA Base Pin
RedDk26-Nov-22 9:08
RedDk26-Nov-22 9:08 
GeneralRe: Store Rich Text in DATA Base Pin
CARBER26-Nov-22 11:03
CARBER26-Nov-22 11:03 
AnswerRe: Store Rich Text in DATA Base Pin
Sam Hobbs26-Nov-22 12:22
Sam Hobbs26-Nov-22 12:22 
QuestionSuggestion on searching thru jobs and resumes Pin
Michael Clinton21-Oct-22 9:44
Michael Clinton21-Oct-22 9:44 
AnswerRe: Suggestion on searching thru jobs and resumes Pin
Richard MacCutchan21-Oct-22 21:43
mveRichard MacCutchan21-Oct-22 21:43 
AnswerRe: Suggestion on searching thru jobs and resumes Pin
rareprob solutions31-Oct-22 22:54
rareprob solutions31-Oct-22 22:54 
AnswerRe: Suggestion on searching thru jobs and resumes Pin
jsc4226-Nov-22 4:59
professionaljsc4226-Nov-22 4:59 
Question(SOLVED) Error: The string was not recognized as a valid DateTime. There is an unknown word starting at index 0. Pin
samflex19-Oct-22 8:11
samflex19-Oct-22 8:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.