Polymorphisme pour create.cshtml/create.cshtml.cs ?

Laurent Guigon 311 Reputation points
2022-12-18T17:08:05.103+00:00

Hi,
I have a model class named "Paragraph Line"
and two other classes, Paragraph and Summary, which both contain a collection of Paragraph Lines. Paragraph line has foreign keys Guid? ParagraphId and Guid? SummaryId, filled in according to the attachment to a paragraph or a summary.
I have a "create" form for a Paragraph Line, but the behaviors are different depending on the type of the parent (notably the GetParent(parentId) method which returns an instance of Paragraph or of Summary).
I am thinking of using polymorphism for the Create.cshtml and Create.csthml.cs files, can you give me advice on the best way to manage?
Thanks in advance.

Developer technologies | ASP.NET | ASP.NET Core
{count} votes

1 answer

Sort by: Most helpful
  1. Laurent Guigon 311 Reputation points
    2023-01-18T12:25:32.8033333+00:00

    I'm building a new design for my app. So the problem is removed.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.