complex-data-types

MVC post a list of complex objects

自作多情 提交于 2019-12-17 10:49:21
问题 I have a FeedbackViewModel that contains a list of questions: public class FeedbackViewModel { public List<QuestionViewModel> Questions { get; set; } } This QuestionViewModel is an object that can be inherited by 5 different types of questions public class QuestionViewModel { public string QuestionText { get; set; } public string QuestionType { get; set; } } An example of one of the inheriting question types: public class SingleQuestionViewModel : QuestionViewModel { public string AnswerText

how do you go about dealing with ajax and Model Binding when complex types are involved?

允我心安 提交于 2019-12-10 11:34:45
问题 I would like to keep model binding when doing ajax calls from my view. I'm using jquery ajax to make the calls, and just as an example- this is my controller method I want to call from ajax: public ActionResult Create(Person personToCreate) { //Create person here } As you can see, this method is relying on Model Binding. This makes the method a lot cleaner... however, this means that when the ajax makes a call, it must supply all variables that are non-nullable in the DB. So, if I have a

Is Java's BigDecimal the closest data type corresponding to C#'s Decimal?

妖精的绣舞 提交于 2019-11-30 18:23:57
According to the chart here , the equivalent data type in Java to C#'s Decimal is BigDecimal . Is this really so? What's up with the "Big" preamble? There doesn't seem to be a "SmallDecimal" or "LittleDecimal" (let alone "MediumSizedDecimal") in Java. I must say, though, that chart was the clearest thing I found on the subject; the other links here and here and here were about as clear to me as the Mississippi River after a torrential tempest. Yep - that's the corresponding type. Since you are using Java after C# - don't be too surprised to find little nuances like this - or be too upset when

Is Java's BigDecimal the closest data type corresponding to C#'s Decimal?

你离开我真会死。 提交于 2019-11-30 02:09:31
问题 According to the chart here, the equivalent data type in Java to C#'s Decimal is BigDecimal . Is this really so? What's up with the "Big" preamble? There doesn't seem to be a "SmallDecimal" or "LittleDecimal" (let alone "MediumSizedDecimal") in Java. I must say, though, that chart was the clearest thing I found on the subject; the other links here and here and here were about as clear to me as the Mississippi River after a torrential tempest. 回答1: Yep - that's the corresponding type. Since

Complex data types in WCF?

六月ゝ 毕业季﹏ 提交于 2019-11-28 16:25:25
I've run into a problem trying to return an object that holds a collection of childobjects that again can hold a collection of grandchild objects. I get an error, 'connection forcibly closed by host'. Is there any way to make this work? I currently have a structure resembling this: pseudo code: Person: IEnumerable<Order> Order: IEnumerable<OrderLine> All three objects have the DataContract attribute and all public properties i want exposed (including the IEnumerable's) have the DataMember attribute. I have multiple OperationContract's on my service and all the methods returning a single object

MVC post a list of complex objects

耗尽温柔 提交于 2019-11-27 13:16:28
I have a FeedbackViewModel that contains a list of questions: public class FeedbackViewModel { public List<QuestionViewModel> Questions { get; set; } } This QuestionViewModel is an object that can be inherited by 5 different types of questions public class QuestionViewModel { public string QuestionText { get; set; } public string QuestionType { get; set; } } An example of one of the inheriting question types: public class SingleQuestionViewModel : QuestionViewModel { public string AnswerText { get; set; } } In the HttpGet of the Index action in the controller I get the questions from the

Complex data types in WCF?

浪尽此生 提交于 2019-11-27 09:41:43
问题 I've run into a problem trying to return an object that holds a collection of childobjects that again can hold a collection of grandchild objects. I get an error, 'connection forcibly closed by host'. Is there any way to make this work? I currently have a structure resembling this: pseudo code: Person: IEnumerable<Order> Order: IEnumerable<OrderLine> All three objects have the DataContract attribute and all public properties i want exposed (including the IEnumerable's) have the DataMember