Quellcode durchsuchen

Added MVC projects; added some DBOs in Auth

master
Robin Thoni vor 6 Jahren
Ursprung
Commit
775a0be4a9
26 geänderte Dateien mit 617 neuen und 16 gelöschten Zeilen
  1. 64
    3
      .idea/.idea.luticate2/.idea/contentModel.xml
  2. 9
    0
      Luticate2.Auth.ConsoleSample/Luticate2.Auth.ConsoleSample.csproj
  3. 12
    0
      Luticate2.Auth.ConsoleSample/Program.cs
  4. 7
    0
      Luticate2.Auth/Dbo/Basic/LuAuthOptions.cs
  5. 35
    0
      Luticate2.Auth/Dbo/LuDboExtensions.cs
  6. 54
    0
      Luticate2.Auth/Dbo/Pagination/LuFilterDbo.cs
  7. 9
    0
      Luticate2.Auth/Dbo/Pagination/LuOrderByDbo.cs
  8. 9
    0
      Luticate2.Auth/Dbo/Pagination/LuOrderByFieldDbo.cs
  9. 11
    0
      Luticate2.Auth/Dbo/Pagination/LuPaginatedDbo.cs
  10. 13
    0
      Luticate2.Auth/Dbo/Pagination/LuPaginatedParamsDbo.cs
  11. 93
    0
      Luticate2.Auth/Dbo/Result/LuResult.cs
  12. 26
    0
      Luticate2.Auth/Dbo/Result/LuStatus.cs
  13. 21
    0
      Luticate2.Auth/Exceptions/LuExceptionsExtensions.cs
  14. 15
    0
      Luticate2.Auth/Exceptions/LuResultException.cs
  15. 9
    7
      Luticate2.Auth/Luticate2.Auth.csproj
  16. 15
    0
      Luticate2.Mvc.Auth.Tests/Luticate2.Mvc.Auth.Tests.csproj
  17. 16
    0
      Luticate2.Mvc.Auth.Tests/UnitTest1.cs
  18. 44
    0
      Luticate2.Mvc.Auth.WebApiSample/Controllers/ValuesController.cs
  19. 17
    0
      Luticate2.Mvc.Auth.WebApiSample/Luticate2.Mvc.Auth.WebApiSample.csproj
  20. 25
    0
      Luticate2.Mvc.Auth.WebApiSample/Program.cs
  21. 40
    0
      Luticate2.Mvc.Auth.WebApiSample/Startup.cs
  22. 10
    0
      Luticate2.Mvc.Auth.WebApiSample/appsettings.Development.json
  23. 15
    0
      Luticate2.Mvc.Auth.WebApiSample/appsettings.json
  24. 12
    0
      Luticate2.Mvc.Auth/Class1.cs
  25. 7
    0
      Luticate2.Mvc.Auth/Luticate2.Mvc.Auth.csproj
  26. 29
    6
      luticate2.sln

+ 64
- 3
.idea/.idea.luticate2/.idea/contentModel.xml Datei anzeigen

@@ -8,7 +8,30 @@
8 8
     <e p="$PROJECT_DIR$" t="IncludeFlat">
9 9
       <e p="Auth" t="Include" />
10 10
       <e p="Luticate2.Auth" t="IncludeRecursive">
11
+        <e p="Business" t="Include" />
11 12
         <e p="Class1.cs" t="Include" />
13
+        <e p="Dbo" t="Include">
14
+          <e p="Basic" t="Include">
15
+            <e p="LuAuthOptions.cs" t="Include" />
16
+          </e>
17
+          <e p="LuDboExtensions.cs" t="Include" />
18
+          <e p="Pagination" t="Include">
19
+            <e p="LuFilterDbo.cs" t="Include" />
20
+            <e p="LuOrderByDbo.cs" t="Include" />
21
+            <e p="LuOrderByFieldDbo.cs" t="Include" />
22
+            <e p="LuPaginatedDbo.cs" t="Include" />
23
+            <e p="LuPaginatedParamsDbo.cs" t="Include" />
24
+          </e>
25
+          <e p="Result" t="Include">
26
+            <e p="LuResult.cs" t="Include" />
27
+            <e p="LuStatus.cs" t="Include" />
28
+          </e>
29
+        </e>
30
+        <e p="Exceptions" t="Include">
31
+          <e p="LuExceptionsExtensions.cs" t="Include" />
32
+          <e p="LuResultException.cs" t="Include" />
33
+        </e>
34
+        <e p="Interfaces" t="Include" />
12 35
         <e p="Luticate2.Auth.csproj" t="IncludeRecursive" />
13 36
         <e p="bin" t="ExcludeRecursive" />
14 37
         <e p="obj" t="ExcludeRecursive">
@@ -19,6 +42,18 @@
19 42
           </e>
20 43
         </e>
21 44
       </e>
45
+      <e p="Luticate2.Auth.ConsoleSample" t="IncludeRecursive">
46
+        <e p="Luticate2.Auth.ConsoleSample.csproj" t="IncludeRecursive" />
47
+        <e p="Program.cs" t="Include" />
48
+        <e p="bin" t="ExcludeRecursive" />
49
+        <e p="obj" t="ExcludeRecursive">
50
+          <e p="Debug" t="Include">
51
+            <e p="netcoreapp2.0" t="Include">
52
+              <e p="Luticate2.Auth.ConsoleSample.AssemblyInfo.cs" t="Include" />
53
+            </e>
54
+          </e>
55
+        </e>
56
+      </e>
22 57
       <e p="Luticate2.Auth.Tests" t="IncludeRecursive">
23 58
         <e p="Luticate2.Auth.Tests.csproj" t="IncludeRecursive" />
24 59
         <e p="UnitTest1.cs" t="Include" />
@@ -32,11 +67,36 @@
32 67
           </e>
33 68
         </e>
34 69
       </e>
35
-      <e p="Luticate2.Auth.WebApiSample" t="IncludeRecursive">
70
+      <e p="Luticate2.Mvc.Auth" t="IncludeRecursive">
71
+        <e p="Class1.cs" t="Include" />
72
+        <e p="Luticate2.Mvc.Auth.csproj" t="IncludeRecursive" />
73
+        <e p="bin" t="ExcludeRecursive" />
74
+        <e p="obj" t="ExcludeRecursive">
75
+          <e p="Debug" t="Include">
76
+            <e p="netstandard2.0" t="Include">
77
+              <e p="Luticate2.Mvc.Auth.AssemblyInfo.cs" t="Include" />
78
+            </e>
79
+          </e>
80
+        </e>
81
+      </e>
82
+      <e p="Luticate2.Mvc.Auth.Tests" t="IncludeRecursive">
83
+        <e p="Luticate2.Mvc.Auth.Tests.csproj" t="IncludeRecursive" />
84
+        <e p="UnitTest1.cs" t="Include" />
85
+        <e p="bin" t="ExcludeRecursive" />
86
+        <e p="obj" t="ExcludeRecursive">
87
+          <e p="Debug" t="Include">
88
+            <e p="netcoreapp2.0" t="Include">
89
+              <e p="Luticate2.Mvc.Auth.Tests.AssemblyInfo.cs" t="Include" />
90
+              <e p="Luticate2.Mvc.Auth.Tests.Program.cs" t="Include" />
91
+            </e>
92
+          </e>
93
+        </e>
94
+      </e>
95
+      <e p="Luticate2.Mvc.Auth.WebApiSample" t="IncludeRecursive">
36 96
         <e p="Controllers" t="Include">
37 97
           <e p="ValuesController.cs" t="Include" />
38 98
         </e>
39
-        <e p="Luticate2.Auth.WebApiSample.csproj" t="IncludeRecursive" />
99
+        <e p="Luticate2.Mvc.Auth.WebApiSample.csproj" t="IncludeRecursive" />
40 100
         <e p="Program.cs" t="Include" />
41 101
         <e p="Startup.cs" t="Include" />
42 102
         <e p="appsettings.Development.json" t="Include" />
@@ -45,12 +105,13 @@
45 105
         <e p="obj" t="ExcludeRecursive">
46 106
           <e p="Debug" t="Include">
47 107
             <e p="netcoreapp2.0" t="Include">
48
-              <e p="Luticate2.Auth.WebApiSample.AssemblyInfo.cs" t="Include" />
108
+              <e p="Luticate2.Mvc.Auth.WebApiSample.AssemblyInfo.cs" t="Include" />
49 109
             </e>
50 110
           </e>
51 111
         </e>
52 112
         <e p="wwwroot" t="Include" />
53 113
       </e>
114
+      <e p="Mvc.Auth" t="Include" />
54 115
       <e p="luticate2.sln" t="IncludeFlat" />
55 116
       <e p="packages" t="ExcludeRecursive" />
56 117
     </e>

+ 9
- 0
Luticate2.Auth.ConsoleSample/Luticate2.Auth.ConsoleSample.csproj Datei anzeigen

@@ -0,0 +1,9 @@
1
+<Project Sdk="Microsoft.NET.Sdk">
2
+  <PropertyGroup>
3
+    <OutputType>Exe</OutputType>
4
+    <TargetFramework>netcoreapp2.0</TargetFramework>
5
+  </PropertyGroup>
6
+  <ItemGroup>
7
+    <ProjectReference Include="..\Luticate2.Auth\Luticate2.Auth.csproj" />
8
+  </ItemGroup>
9
+</Project>

+ 12
- 0
Luticate2.Auth.ConsoleSample/Program.cs Datei anzeigen

@@ -0,0 +1,12 @@
1
+using System;
2
+
3
+namespace Luticate2.Auth.ConsoleSample
4
+{
5
+    class Program
6
+    {
7
+        static void Main(string[] args)
8
+        {
9
+            Console.WriteLine(Class1.Method1("Hello World!"));
10
+        }
11
+    }
12
+}

+ 7
- 0
Luticate2.Auth/Dbo/Basic/LuAuthOptions.cs Datei anzeigen

@@ -0,0 +1,7 @@
1
+namespace Luticate2.Auth.Dbo.Basic
2
+{
3
+    public class LuAuthOptions
4
+    {
5
+        public string Version { get; set; }
6
+    }
7
+}

+ 35
- 0
Luticate2.Auth/Dbo/LuDboExtensions.cs Datei anzeigen

@@ -0,0 +1,35 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using Luticate2.Auth.Dbo.Pagination;
5
+using Luticate2.Auth.Dbo.Result;
6
+
7
+namespace Luticate2.Auth.Dbo
8
+{
9
+    public static class LuDboExtensions
10
+    {
11
+        public static int ToInt(this LuStatus status)
12
+        {
13
+            return (int) status;
14
+        }
15
+
16
+        // TODO?
17
+//        public static LuPaginatedDbo<TDbo> To<TDbo>(this LuPaginatedDbo<TDbo> data, Func<List<TDbo>, List<TDbo>> convert)
18
+//        {
19
+//            return new LuPaginatedDbo<TDbo>
20
+//            {
21
+//                Count = data.Count,
22
+//                Data = convert(data.Data)
23
+//            };
24
+//        }
25
+//
26
+//        public static LuPaginatedDbo<TDbo> Select<TDbo>(this LuPaginatedDbo<TDbo> data, Func<TDbo, TDbo> convert)
27
+//        {
28
+//            return new LuPaginatedDbo<TDbo>
29
+//            {
30
+//                Count = data.Count,
31
+//                Data = data.Data.Select(convert).ToList()
32
+//            };
33
+//        }
34
+    }
35
+}

+ 54
- 0
Luticate2.Auth/Dbo/Pagination/LuFilterDbo.cs Datei anzeigen

@@ -0,0 +1,54 @@
1
+using System.Collections.Generic;
2
+
3
+namespace Luticate2.Auth.Dbo.Pagination
4
+{
5
+    public class LuFilterDbo
6
+    {
7
+        public string Query { get; set; }
8
+
9
+        public IDictionary<string, string> Filters { get; set; }
10
+
11
+        public string GetFilterString(string key, string defaultValue)
12
+        {
13
+            if (!Filters.ContainsKey(key))
14
+            {
15
+                return defaultValue;
16
+            }
17
+            return Filters[key];
18
+        }
19
+
20
+        public bool? GetFilterBool(string key, bool? defaultValue)
21
+        {
22
+            var value = GetFilterString(key, "").ToLower();
23
+            if (value == "true")
24
+            {
25
+                return true;
26
+            }
27
+            if (value == "false")
28
+            {
29
+                return false;
30
+            }
31
+            return defaultValue;
32
+        }
33
+
34
+        public int? GetFilterInt(string key, int? defaultValue)
35
+        {
36
+            int v;
37
+            if (int.TryParse(GetFilterString(key, ""), out v))
38
+            {
39
+                return v;
40
+            }
41
+            return defaultValue;
42
+        }
43
+
44
+        public double? GetFilterFloat(string key, double? defaultValue)
45
+        {
46
+            double v;
47
+            if (double.TryParse(GetFilterString(key, ""), out v))
48
+            {
49
+                return v;
50
+            }
51
+            return defaultValue;
52
+        }
53
+    }
54
+}

+ 9
- 0
Luticate2.Auth/Dbo/Pagination/LuOrderByDbo.cs Datei anzeigen

@@ -0,0 +1,9 @@
1
+using System.Collections.Generic;
2
+
3
+namespace Luticate2.Auth.Dbo.Pagination
4
+{
5
+    public class LuOrderByDbo
6
+    {
7
+        public IList<LuOrderByFieldDbo> Fields { get; set; }
8
+    }
9
+}

+ 9
- 0
Luticate2.Auth/Dbo/Pagination/LuOrderByFieldDbo.cs Datei anzeigen

@@ -0,0 +1,9 @@
1
+namespace Luticate2.Auth.Dbo.Pagination
2
+{
3
+    public class LuOrderByFieldDbo
4
+    {
5
+        public string Name { get; set; }
6
+
7
+        public bool Asc { get; set; }
8
+    }
9
+}

+ 11
- 0
Luticate2.Auth/Dbo/Pagination/LuPaginatedDbo.cs Datei anzeigen

@@ -0,0 +1,11 @@
1
+using System.Collections.Generic;
2
+
3
+namespace Luticate2.Auth.Dbo.Pagination
4
+{
5
+    public class LuPaginatedDbo<TDbo>
6
+    {
7
+        public long Count { get; set; }
8
+
9
+        public List<TDbo> Data { get; set; }
10
+    }
11
+}

+ 13
- 0
Luticate2.Auth/Dbo/Pagination/LuPaginatedParamsDbo.cs Datei anzeigen

@@ -0,0 +1,13 @@
1
+namespace Luticate2.Auth.Dbo.Pagination
2
+{
3
+    public class LuPaginatedParamsDbo
4
+    {
5
+        public LuFilterDbo Filter { get; set; }
6
+
7
+        public LuOrderByDbo OrderBy { get; set; }
8
+
9
+        public int Page { get; set; }
10
+
11
+        public int PerPage { get; set; }
12
+    }
13
+}

+ 93
- 0
Luticate2.Auth/Dbo/Result/LuResult.cs Datei anzeigen

@@ -0,0 +1,93 @@
1
+using System;
2
+
3
+namespace Luticate2.Auth.Dbo.Result
4
+{
5
+    public class LuResult<T>
6
+    {
7
+        public int Status { get; set; }
8
+
9
+        public bool Success => Status == LuStatus.Success.ToInt();
10
+
11
+        public string PublicDetails { get; set; }
12
+
13
+        public string PrivateDetails { get; set; }
14
+
15
+        public string StackTrace { get; set; }
16
+
17
+        public Exception Exception { get; set; }
18
+
19
+        public T Data { get; set; }
20
+
21
+        protected LuResult()
22
+        {
23
+        }
24
+
25
+        public static LuResult<T> Ok(T data)
26
+        {
27
+            return new LuResult<T>
28
+            {
29
+                StackTrace = new Exception().StackTrace,
30
+                Data = data,
31
+                Status = LuStatus.Success.ToInt()
32
+            };
33
+        }
34
+
35
+        public static LuResult<T> Error(int status, string privateDetails, string publicDetails = null)
36
+        {
37
+            return new LuResult<T>
38
+            {
39
+                PublicDetails = publicDetails == "" ? privateDetails : publicDetails,
40
+                PrivateDetails = privateDetails,
41
+                StackTrace = new Exception().StackTrace,
42
+                Status = status
43
+            };
44
+        }
45
+
46
+        public static LuResult<T> Error(int status, Exception e, string publicDetails = null)
47
+        {
48
+            return new LuResult<T>
49
+            {
50
+                PublicDetails = publicDetails,
51
+                PrivateDetails = e.ToString(),
52
+                StackTrace = new Exception().StackTrace,
53
+                Exception = e,
54
+                Status = status
55
+            };
56
+        }
57
+
58
+        public static LuResult<T> Error<T2>(LuResult<T2> other)
59
+        {
60
+            return new LuResult<T>
61
+            {
62
+                Status = other.Status,
63
+                PublicDetails = other.PublicDetails,
64
+                PrivateDetails = other.PrivateDetails,
65
+                StackTrace = other.StackTrace,
66
+                Exception = other.Exception
67
+            };
68
+        }
69
+
70
+        public LuResult<T2> To<T2>()
71
+        {
72
+            return LuResult<T2>.Error(this);
73
+        }
74
+
75
+        public LuResult<T2> To<T2>(Func<T, T2> convert)
76
+        {
77
+            return new LuResult<T2>
78
+            {
79
+                Data = Success ? convert(Data) : default(T2),
80
+                Status = Status,
81
+                PublicDetails = PublicDetails,
82
+                PrivateDetails = PrivateDetails,
83
+                StackTrace = StackTrace,
84
+                Exception = Exception
85
+            };
86
+        }
87
+
88
+        public static implicit operator bool(LuResult<T> res)
89
+        {
90
+            return res.Success;
91
+        }
92
+    }
93
+}

+ 26
- 0
Luticate2.Auth/Dbo/Result/LuStatus.cs Datei anzeigen

@@ -0,0 +1,26 @@
1
+namespace Luticate2.Auth.Dbo.Result
2
+{
3
+    /// <summary>
4
+    /// Represents a success or error code used for <see cref="LuResult{T}"/>.
5
+    /// Codes strictly less than 1000 are reserved. Any other value can be used by user for custom error reporting.
6
+    /// </summary>
7
+    public enum LuStatus
8
+    {
9
+        // Success
10
+        Success = 1,
11
+        
12
+        // Generic errors
13
+        InternalError = 10,
14
+        InputError = 11,
15
+        NotFound = 12,
16
+        
17
+        // Backend errors
18
+        BackendError = 20,
19
+        DbError = 21,
20
+        FsError = 22,
21
+        
22
+        // Auth errors
23
+        LoginError = 30,
24
+        PermissionError = 31
25
+    }
26
+}

+ 21
- 0
Luticate2.Auth/Exceptions/LuExceptionsExtensions.cs Datei anzeigen

@@ -0,0 +1,21 @@
1
+using Luticate2.Auth.Dbo.Result;
2
+
3
+namespace Luticate2.Auth.Exceptions
4
+{
5
+    public static class LuExceptionsExtensions
6
+    {
7
+        public static void Throw<T>(this LuResult<T> result)
8
+        {
9
+            throw new LuResultException(result.To<object>());
10
+        }
11
+
12
+        public static LuResult<T> ThrowIfNotSuccess<T>(this LuResult<T> result)
13
+        {
14
+            if (!result)
15
+            {
16
+                result.Throw();
17
+            }
18
+            return result;
19
+        }
20
+    }
21
+}

+ 15
- 0
Luticate2.Auth/Exceptions/LuResultException.cs Datei anzeigen

@@ -0,0 +1,15 @@
1
+using System;
2
+using Luticate2.Auth.Dbo.Result;
3
+
4
+namespace Luticate2.Auth.Exceptions
5
+{
6
+    public class LuResultException : Exception
7
+    {
8
+        public LuResult<object> Result { get; set; }
9
+
10
+        public LuResultException(LuResult<object> result) : base(result.PrivateDetails, result.Exception)
11
+        {
12
+            Result = result;
13
+        }
14
+    }
15
+}

+ 9
- 7
Luticate2.Auth/Luticate2.Auth.csproj Datei anzeigen

@@ -1,7 +1,9 @@
1
-<Project Sdk="Microsoft.NET.Sdk">
2
-
3
-    <PropertyGroup>
4
-        <TargetFramework>netstandard2.0</TargetFramework>
5
-    </PropertyGroup>
6
-
7
-</Project>
1
+<Project Sdk="Microsoft.NET.Sdk">
2
+  <PropertyGroup>
3
+    <TargetFramework>netstandard2.0</TargetFramework>
4
+  </PropertyGroup>
5
+  <ItemGroup>
6
+    <Folder Include="Business" />
7
+    <Folder Include="Interfaces" />
8
+  </ItemGroup>
9
+</Project>

+ 15
- 0
Luticate2.Mvc.Auth.Tests/Luticate2.Mvc.Auth.Tests.csproj Datei anzeigen

@@ -0,0 +1,15 @@
1
+<Project Sdk="Microsoft.NET.Sdk">
2
+  <PropertyGroup>
3
+    <TargetFramework>netcoreapp2.0</TargetFramework>
4
+    <IsPackable>false</IsPackable>
5
+  </PropertyGroup>
6
+  <ItemGroup>
7
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
8
+    <PackageReference Include="xunit" Version="2.3.1" />
9
+    <PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
10
+    <DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
11
+  </ItemGroup>
12
+  <ItemGroup>
13
+    <ProjectReference Include="..\Luticate2.Mvc.Auth\Luticate2.Mvc.Auth.csproj" />
14
+  </ItemGroup>
15
+</Project>

+ 16
- 0
Luticate2.Mvc.Auth.Tests/UnitTest1.cs Datei anzeigen

@@ -0,0 +1,16 @@
1
+using System;
2
+using Xunit;
3
+
4
+namespace Luticate2.Mvc.Auth.Tests
5
+{
6
+    public class UnitTest1
7
+    {
8
+        [Fact]
9
+        public void Test1()
10
+        {
11
+            string expected = "testValue 0";
12
+            string actual = Class1.Method1("0");
13
+            Assert.Equal(expected, actual);
14
+        }
15
+    }
16
+}

+ 44
- 0
Luticate2.Mvc.Auth.WebApiSample/Controllers/ValuesController.cs Datei anzeigen

@@ -0,0 +1,44 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Threading.Tasks;
5
+using Microsoft.AspNetCore.Mvc;
6
+
7
+namespace Luticate2.Mvc.Auth.WebApiSample.Controllers
8
+{
9
+    [Route("api/[controller]")]
10
+    public class ValuesController : Controller
11
+    {
12
+        // GET api/values
13
+        [HttpGet]
14
+        public IEnumerable<string> Get()
15
+        {
16
+            return new string[] {Class1.Method1("value1"), Class1.Method1("value2")};
17
+        }
18
+
19
+        // GET api/values/5
20
+        [HttpGet("{id}")]
21
+        public string Get(int id)
22
+        {
23
+            return "value";
24
+        }
25
+
26
+        // POST api/values
27
+        [HttpPost]
28
+        public void Post([FromBody] string value)
29
+        {
30
+        }
31
+
32
+        // PUT api/values/5
33
+        [HttpPut("{id}")]
34
+        public void Put(int id, [FromBody] string value)
35
+        {
36
+        }
37
+
38
+        // DELETE api/values/5
39
+        [HttpDelete("{id}")]
40
+        public void Delete(int id)
41
+        {
42
+        }
43
+    }
44
+}

+ 17
- 0
Luticate2.Mvc.Auth.WebApiSample/Luticate2.Mvc.Auth.WebApiSample.csproj Datei anzeigen

@@ -0,0 +1,17 @@
1
+<Project Sdk="Microsoft.NET.Sdk.Web">
2
+  <PropertyGroup>
3
+    <TargetFramework>netcoreapp2.0</TargetFramework>
4
+  </PropertyGroup>
5
+  <ItemGroup>
6
+    <Folder Include="wwwroot\" />
7
+  </ItemGroup>
8
+  <ItemGroup>
9
+    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.5" />
10
+  </ItemGroup>
11
+  <ItemGroup>
12
+    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.2" />
13
+  </ItemGroup>
14
+  <ItemGroup>
15
+    <ProjectReference Include="..\Luticate2.Mvc.Auth\Luticate2.Mvc.Auth.csproj" />
16
+  </ItemGroup>
17
+</Project>

+ 25
- 0
Luticate2.Mvc.Auth.WebApiSample/Program.cs Datei anzeigen

@@ -0,0 +1,25 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.IO;
4
+using System.Linq;
5
+using System.Threading.Tasks;
6
+using Microsoft.AspNetCore;
7
+using Microsoft.AspNetCore.Hosting;
8
+using Microsoft.Extensions.Configuration;
9
+using Microsoft.Extensions.Logging;
10
+
11
+namespace Luticate2.Mvc.Auth.WebApiSample
12
+{
13
+    public class Program
14
+    {
15
+        public static void Main(string[] args)
16
+        {
17
+            BuildWebHost(args).Run();
18
+        }
19
+
20
+        public static IWebHost BuildWebHost(string[] args) =>
21
+            WebHost.CreateDefaultBuilder(args)
22
+                .UseStartup<Startup>()
23
+                .Build();
24
+    }
25
+}

+ 40
- 0
Luticate2.Mvc.Auth.WebApiSample/Startup.cs Datei anzeigen

@@ -0,0 +1,40 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Threading.Tasks;
5
+using Microsoft.AspNetCore.Builder;
6
+using Microsoft.AspNetCore.Hosting;
7
+using Microsoft.Extensions.Configuration;
8
+using Microsoft.Extensions.DependencyInjection;
9
+using Microsoft.Extensions.Logging;
10
+using Microsoft.Extensions.Options;
11
+
12
+namespace Luticate2.Mvc.Auth.WebApiSample
13
+{
14
+    public class Startup
15
+    {
16
+        public Startup(IConfiguration configuration)
17
+        {
18
+            Configuration = configuration;
19
+        }
20
+
21
+        public IConfiguration Configuration { get; }
22
+
23
+        // This method gets called by the runtime. Use this method to add services to the container.
24
+        public void ConfigureServices(IServiceCollection services)
25
+        {
26
+            services.AddMvc();
27
+        }
28
+
29
+        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
30
+        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
31
+        {
32
+            if (env.IsDevelopment())
33
+            {
34
+                app.UseDeveloperExceptionPage();
35
+            }
36
+
37
+            app.UseMvc();
38
+        }
39
+    }
40
+}

+ 10
- 0
Luticate2.Mvc.Auth.WebApiSample/appsettings.Development.json Datei anzeigen

@@ -0,0 +1,10 @@
1
+{
2
+  "Logging": {
3
+    "IncludeScopes": false,
4
+    "LogLevel": {
5
+      "Default": "Debug",
6
+      "System": "Information",
7
+      "Microsoft": "Information"
8
+    }
9
+  }
10
+}

+ 15
- 0
Luticate2.Mvc.Auth.WebApiSample/appsettings.json Datei anzeigen

@@ -0,0 +1,15 @@
1
+{
2
+  "Logging": {
3
+    "IncludeScopes": false,
4
+    "Debug": {
5
+      "LogLevel": {
6
+        "Default": "Warning"
7
+      }
8
+    },
9
+    "Console": {
10
+      "LogLevel": {
11
+        "Default": "Warning"
12
+      }
13
+    }
14
+  }
15
+}

+ 12
- 0
Luticate2.Mvc.Auth/Class1.cs Datei anzeigen

@@ -0,0 +1,12 @@
1
+using System;
2
+
3
+namespace Luticate2.Mvc.Auth
4
+{
5
+    public class Class1
6
+    {
7
+        public static string Method1(string arg1)
8
+        {
9
+            return $"testValue {arg1}";
10
+        }
11
+    }
12
+}

+ 7
- 0
Luticate2.Mvc.Auth/Luticate2.Mvc.Auth.csproj Datei anzeigen

@@ -0,0 +1,7 @@
1
+<Project Sdk="Microsoft.NET.Sdk">
2
+
3
+    <PropertyGroup>
4
+        <TargetFramework>netstandard2.0</TargetFramework>
5
+    </PropertyGroup>
6
+
7
+</Project>

+ 29
- 6
luticate2.sln Datei anzeigen

@@ -6,7 +6,15 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Luticate2.Auth", "Luticate2
6 6
 EndProject
7 7
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Luticate2.Auth.Tests", "Luticate2.Auth.Tests\Luticate2.Auth.Tests.csproj", "{82A268E9-361D-4F4A-B3A9-3810C5275587}"
8 8
 EndProject
9
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Luticate2.Auth.WebApiSample", "Luticate2.Auth.WebApiSample\Luticate2.Auth.WebApiSample.csproj", "{0621B806-7B96-4C0B-BA14-F98E6ECCB322}"
9
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mvc.Auth", "Mvc.Auth", "{ACF46E3B-F5EF-4A04-85B9-B2EAE6E1797D}"
10
+EndProject
11
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Luticate2.Mvc.Auth", "Luticate2.Mvc.Auth\Luticate2.Mvc.Auth.csproj", "{33168D59-7191-42C2-8774-0B45BBF4C10A}"
12
+EndProject
13
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Luticate2.Mvc.Auth.Tests", "Luticate2.Mvc.Auth.Tests\Luticate2.Mvc.Auth.Tests.csproj", "{AD7E43AA-2AEF-469C-A30C-0144A92E6CE6}"
14
+EndProject
15
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Luticate2.Auth.ConsoleSample", "Luticate2.Auth.ConsoleSample\Luticate2.Auth.ConsoleSample.csproj", "{65809E11-3C5B-4641-9710-E8EEF47A72E1}"
16
+EndProject
17
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Luticate2.Mvc.Auth.WebApiSample", "Luticate2.Mvc.Auth.WebApiSample\Luticate2.Mvc.Auth.WebApiSample.csproj", "{E5FB71F0-F91B-427B-BA91-27B274BC077D}"
10 18
 EndProject
11 19
 Global
12 20
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -16,7 +24,10 @@ Global
16 24
 	GlobalSection(NestedProjects) = preSolution
17 25
 		{11727D2F-E2EE-4FD5-BEC4-C22B5B0D38A2} = {A9D48433-4DD9-4CEC-89FA-0350C942EFC9}
18 26
 		{82A268E9-361D-4F4A-B3A9-3810C5275587} = {A9D48433-4DD9-4CEC-89FA-0350C942EFC9}
19
-		{0621B806-7B96-4C0B-BA14-F98E6ECCB322} = {A9D48433-4DD9-4CEC-89FA-0350C942EFC9}
27
+		{33168D59-7191-42C2-8774-0B45BBF4C10A} = {ACF46E3B-F5EF-4A04-85B9-B2EAE6E1797D}
28
+		{AD7E43AA-2AEF-469C-A30C-0144A92E6CE6} = {ACF46E3B-F5EF-4A04-85B9-B2EAE6E1797D}
29
+		{65809E11-3C5B-4641-9710-E8EEF47A72E1} = {A9D48433-4DD9-4CEC-89FA-0350C942EFC9}
30
+		{E5FB71F0-F91B-427B-BA91-27B274BC077D} = {ACF46E3B-F5EF-4A04-85B9-B2EAE6E1797D}
20 31
 	EndGlobalSection
21 32
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
22 33
 		{11727D2F-E2EE-4FD5-BEC4-C22B5B0D38A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
@@ -27,9 +38,21 @@ Global
27 38
 		{82A268E9-361D-4F4A-B3A9-3810C5275587}.Debug|Any CPU.Build.0 = Debug|Any CPU
28 39
 		{82A268E9-361D-4F4A-B3A9-3810C5275587}.Release|Any CPU.ActiveCfg = Release|Any CPU
29 40
 		{82A268E9-361D-4F4A-B3A9-3810C5275587}.Release|Any CPU.Build.0 = Release|Any CPU
30
-		{0621B806-7B96-4C0B-BA14-F98E6ECCB322}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
31
-		{0621B806-7B96-4C0B-BA14-F98E6ECCB322}.Debug|Any CPU.Build.0 = Debug|Any CPU
32
-		{0621B806-7B96-4C0B-BA14-F98E6ECCB322}.Release|Any CPU.ActiveCfg = Release|Any CPU
33
-		{0621B806-7B96-4C0B-BA14-F98E6ECCB322}.Release|Any CPU.Build.0 = Release|Any CPU
41
+		{33168D59-7191-42C2-8774-0B45BBF4C10A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
42
+		{33168D59-7191-42C2-8774-0B45BBF4C10A}.Debug|Any CPU.Build.0 = Debug|Any CPU
43
+		{33168D59-7191-42C2-8774-0B45BBF4C10A}.Release|Any CPU.ActiveCfg = Release|Any CPU
44
+		{33168D59-7191-42C2-8774-0B45BBF4C10A}.Release|Any CPU.Build.0 = Release|Any CPU
45
+		{AD7E43AA-2AEF-469C-A30C-0144A92E6CE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
46
+		{AD7E43AA-2AEF-469C-A30C-0144A92E6CE6}.Debug|Any CPU.Build.0 = Debug|Any CPU
47
+		{AD7E43AA-2AEF-469C-A30C-0144A92E6CE6}.Release|Any CPU.ActiveCfg = Release|Any CPU
48
+		{AD7E43AA-2AEF-469C-A30C-0144A92E6CE6}.Release|Any CPU.Build.0 = Release|Any CPU
49
+		{65809E11-3C5B-4641-9710-E8EEF47A72E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
50
+		{65809E11-3C5B-4641-9710-E8EEF47A72E1}.Debug|Any CPU.Build.0 = Debug|Any CPU
51
+		{65809E11-3C5B-4641-9710-E8EEF47A72E1}.Release|Any CPU.ActiveCfg = Release|Any CPU
52
+		{65809E11-3C5B-4641-9710-E8EEF47A72E1}.Release|Any CPU.Build.0 = Release|Any CPU
53
+		{E5FB71F0-F91B-427B-BA91-27B274BC077D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
54
+		{E5FB71F0-F91B-427B-BA91-27B274BC077D}.Debug|Any CPU.Build.0 = Debug|Any CPU
55
+		{E5FB71F0-F91B-427B-BA91-27B274BC077D}.Release|Any CPU.ActiveCfg = Release|Any CPU
56
+		{E5FB71F0-F91B-427B-BA91-27B274BC077D}.Release|Any CPU.Build.0 = Release|Any CPU
34 57
 	EndGlobalSection
35 58
 EndGlobal

Laden…
Abbrechen
Speichern