-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with filling the nested DTO #13
Comments
Typo mistake please consider any Domain object as Dto above. |
HI @girishmandhale, I'm not sure what you mean by 'no luck' - does it not work at all? If the Detail service doesn't return anything, or is missing the nested DTO that is one thing. If the Detail service works but your Update service call does not update the If the detail service works but the update service doesn't then have a look at the One other point in your example is that I don't see the correct For BuildTemplateDTO it should have : I hope that helps. |
Hi John, Thanks for your quick reply. Yes it was not working. But i did a few changes and it is working now. Please have a look into my below classes. I have not done any additional mapping . I am using the [Table("template_mgt.BuildTemplate")]
[Table("template_mgt.BuildTemplateField")]
public class BuildTemplateFieldDto : EfGenericDto<BuildTemplateField, BuildTemplateFieldDto>
public class BuildTemplateDto : EfGenericDto<BuildTemplate, BuildTemplateDto>
I am calling update service
As i am very new to EF i am having couple of queries.
Thank You |
OK, I will answer your questions in sequence:
Finally I would say that even if you have the IUpdateSetupService service working without the points I raised in the last answer you won't find that the IUpdateService will work, i.e. it won't properly update the Fields (I can't remember what goes wrong - I think you get both the old and the new Fields instead of replacing the existing Fields with the new/updated Fields). |
Thanks Jon. Thanks for resolving above queries. I am using these generic services in my application. We are having some specific scenarios where we need to GET(Read) the data through SQL stored proc as well as Oracle Db. I want to just get the data for the READ operation. Is it possible through GenericServices? |
I think you are best to use EF directly for your SQL Stored Proc. There are ways you can map SQL Stored Procs to a class in such as way that GenericServices can use it, but there isn't really any gain to using GenericServices in this case because it cannot do any mapping, as I explained in my last answer. There is not problem using GenericServices on some calls and calling EF directly for other accesses. I do it myself. Therefore you can use GenericServices on 'normal' accesses and then EF for an access that needs specific EF features, in this case accessing Stored Procs. |
Thanks Jon. |
Hi Jon,
I want to fill my DTO's with nested DTO. I tried as you explained on your wiki site but no luck. Can you please take a look and let me know what i am missing. Below are my classs
[Table("template_mgt.BuildTemplate")]
public partial class BuildTemplate
{
[Table("template_mgt.BuildTemplateField")]
public partial class BuildTemplateField
{
[Key]
public int BuildTemplateFieldID { get; set; }
Below are my corresponding DTO classes
--- BuildTemplateDTO class has a ienumarable that i need to fill.
public class BuildTemplateDTO : EfGenericDto<BuildTemplate, BuildTemplateDTO >
{
public int BuildTemplateID { get; set; }
public class BuildTemplateFieldDto: EfGenericDto<BuildTemplateField, BuildTemplateFieldDto>
{
Thanks in advance.
Thank You
Girish
The text was updated successfully, but these errors were encountered: