About 367,000 results
Open links in new tab
  1. Representing a C# Generic Method in a UML Class Diagram

    Dec 27, 2010 · User is an abstract class, and ICanLogin is another interface. Now, I want to represent the above interface with its method in a UML Class Diagram, in Visio. How can I represent the above generic method with its constraints in a Class Diagram ?

  2. c# - Generic Controllers - Stack Overflow

    Nov 28, 2012 · I have made generic controllers: public class FirstBaseController<TEntity> where TEntity : class, IFirst, new() public class SecondBaseController<TEntity> where TEntity : class, ISecond, new() Then i want to do something like this: public class MyController : FirstBaseController<First>, SecondBaseController<Second>

  3. c# - How to use ASP.NET MVC Generic Controller to populate …

    What's the goal of a generic controller? You will need to show the code where you initialize the Data Block in a controller that currently works. The thing with generics is that you don't access a model by its type; you let your repository return it.

    Missing:

    • Class Diagram

    Must include:

  4. Generic and dynamically generated controllers in ASP.NET …

    Apr 6, 2018 · The names of our controllers - book and album slot themselves into the route template from the base class [Route(“api/[controller]”)], and all of the defined GET/POST operation are automatically available.

    Missing:

    • Class Diagram

    Must include:

  5. How to model Generics (.Net C#) with UML and Enterprise Architect

    Feb 8, 2013 · We want to show you a concrete example how to design a model, i.e., a UML Class Diagram, in Enterprise Architect (EA), with which you might generate C# code using the generic class concepts of .Net. In our case, a non-generic – concrete – class implements a “normal” class and a closed constructed interface.

  6. Build a Generic CRUD API with ASP.NET Core - DEV Community

    May 10, 2021 · To avoid that, I'm going to show you how to build a generic base controller, then you will only have to create controllers that inherit from the base controller, and that's it. The controllers will already have the basic CRUD methods.

  7. C# Class, Interface, Enum and Other Concepts in UML

    Jul 6, 2020 · C# Generic Class. A generic class defines generic parameters. They are represented by UML template parameters. You can add a new template parameter to a class using the ribbon / Model tab / Add group / Template Parameter button.

  8. Generics in C# with Examples - Dot Net Tutorials

    Oct 25, 2022 · How to use Generics with Class and its Members in C#? Let us create a generic class with a generic constructor, generic member variable, generic property, and a generic method. Please create a class file with the name MyGenericClass.cs and then copy and paste the following code into it.

  9. TCDev.de - Tim Cadenbach MVP

    Mar 31, 2022 · Using one generic controller for all the types in your project. First step is to create a generic controller, this is a really simple part, just implement a controller as usually and add T to make it generic. We also need to add a common interface …

  10. Generic CRUD controllers and views - Stack Overflow

    Nov 19, 2014 · Basically, the key is to use generics. In other words, you create a controller like: where TEntity : IEntity, class, new() protected readonly ApplicationDbContext context; public virtual ActionResult Index() var entities = context.Set<TEntity>() return View(entities); public virtual ActionResult Create() var entity = new TEntity();

Refresh