Not able to get the data(ALL except DATETIME) from Database
Not able to get the data(ALL except DATETIME) from Database
I am working on a project in .NET . Is there a way that I can retrieve data without Model?
var response = new Editor(db, "problem", "Id")
//.Model<Problem>()
.TryCatch(false)
.Field(new Field("problem.Id"))
.Field(new Field("problem.Subject"))
.Field(new Field("problem.Message"))
.Field(new Field("problem.AttachmentUrl"))
.Field(new Field("problem.UserID"))
.Field(new Field("user.FirstName"))
.Field(new Field("user.LastName"))
.Field(new Field("problem.LastModified"))
.Field(new Field("problem.DateCreated"))
.LeftJoin("user", "user.Id", "=", "problem.UserID")
.Where("problem.project", "PLAN", "=")
.Process(request)
.Data();
With this, I could retrieve all field except LastModified and DateCreated.
Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi,
Yes - the modal is absolutely optional. You can simply use
Field( new Field(...) )
as you have done to define new fields. In fact all Editor does with the model is to read the properties from it and create newField
instances if they don't already exist.What do you get for those two fields? It is possible you might need to use a get formatter.
Allan
it is just empty value for those 2 field.
Could you show me the JSON returned by the server please? Even better, if you have a link to the page that would be very useful.
Also, did you try using a formatter to show the date in a "nice" format?
Allan
I manage to use the Model to get the value. Thank you very much!