Initial Commit

This commit is contained in:
kdeng00
2021-02-15 20:28:10 -05:00
commit 53e54c4998
3 changed files with 71 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
using System.Collections.Generic;
using System.Linq;
namespace MyTestLib
{
// Test class with a single method
public class MyTestClass
{
// Returns the sum of all the values in the list
#region Methods
public double SumListValues(List<double> values)
{
return values.Sum();
}
#endregion
}
}
+7
View File
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
</Project>
+47
View File
@@ -0,0 +1,47 @@
# MyTestLib
Simple C# library
## Getting Started
Build the library. Debug or release depends on your intent.
```BASH
dotnet build
```
Using the library is simple. Include the path to the dll in your csproj file.
```XML
<ItemGroup>
<Reference Include="MyTestLib">
<HintPath>path/to/MyTestLib.dll</HintPath>
</Reference>
</ItemGroup>
```
Add the using declarative
```C#
using System;
using System.Collections.Generic;
...
using MyTestLib;
...
public void SomeFunction()
{
var myList = new List<double>()
{
1, 1, 2, 3, 5, 8, 13
};
var someLib = new MyTestLib();
// All the values of myList are summed and stored in the sum variable
var sum = someLib.SumListValues(myList);
}
```