Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

How to arrange folders and namespaces in ASP.NET web API application?

$
0
0

Suppose i have a simple web API with a ValuesController.cs file like this:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;

namespace FirstWebAPI.Controllers
{
    [Route("api/[controller]")]
    public class ValuesController : Controller
    {
        // GET api/values
        [HttpGet]
        public IEnumerable<string> Get()
        {
            return SomeMethod();
        }


    }
}

off course i don't want to define SomeMethod() in the same file, i need to arrange my code into buisness and data access layers. is there any convention for this (in terms of folder or namespaces names or locations ?

any resources ?


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>