/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Mvc/test/WebSites/BasicWebSite/CustomService.cs
32 строки
840 B
Benjamin Petit
Support Keyed Services in MVC (#50145)
21 авг 2023, 19:54
Не верифицирован
21 авг 2023, 19:54
81fe483
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using BasicWebSite.Models; using Microsoft.AspNetCore.Http.HttpResults; using Microsoft.AspNetCore.Mvc; namespace BasicWebSite; public interface ICustomService { string Process(); } public class OkCustomService : ICustomService { public string Process() => "OK"; public override string ToString() => Process(); } public class BadCustomService : ICustomService { public string Process() => "NOT OK"; public override string ToString() => Process(); } public class DefaultCustomService : ICustomService { public string Process() => "DEFAULT"; public override string ToString() => Process(); public static DefaultCustomService Instance => new DefaultCustomService(); }