Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace netcoredemo
- open System
- open Microsoft.AspNetCore.Builder
- open Microsoft.AspNetCore.Hosting
- open Microsoft.AspNetCore.Http
- open Microsoft.Extensions.DependencyInjection
- open Microsoft.Extensions.Configuration
- open Microsoft.EntityFrameworkCore
- open Microsoft.AspNetCore.Mvc
- module DB =
- let mutable xs = List.empty
- type Startup(config : IConfiguration) =
- member this.ConfigureServices(services: IServiceCollection) =
- services.AddMvc() <PIPE>> ignore
- member this.Configure(app: IApplicationBuilder, env: IHostingEnvironment) =
- app.UseDeveloperExceptionPage() <PIPE>> ignore
- app.UseMvc() <PIPE>> ignore
- member this.Configuration = config
- type CRUD() =
- inherit Controller()
- [<Route("Create"); HttpPost>]
- member this.Create() =
- let text = Seq.head this.HttpContext.Request.Headers.["text"]
- DB.xs <- (text :: DB.xs)
- "OK"
- [<Route("Read"); HttpGet>]
- member this.Read() =
- DB.xs
- <PIPE>> String.concat "\n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement