初始化项目版本

This commit is contained in:
Sanchime 2022-05-02 16:11:00 +08:00
commit 7f3a01e54a
60 changed files with 996 additions and 0 deletions

View File

@ -0,0 +1,78 @@
using Sanchime.Functional.Core.Products;
namespace Sanchime.Functional.Core.Eithers;
public static class Either
{
public static Left<TLeft> Left<TLeft>(TLeft left)
=> new(left);
public static Right<TRight> Right<TRight>(TRight right)
=> new(right);
}
public readonly struct Either<TLeft, TRight>
{
internal TLeft? Left { get; }
internal TRight? Right { get; }
private bool _isRight { get; }
private bool _isLeft => !_isRight;
internal Either(TLeft left)
=> (_isRight, Left, Right) = (false, left ?? throw new ArgumentNullException(nameof(left)), default);
internal Either(TRight right)
=> (_isRight, Left, Right) = (true, default, right ?? throw new ArgumentNullException(nameof(right)));
public static implicit operator Either<TLeft, TRight>(TLeft left)
=> new(left);
public static implicit operator Either<TLeft, TRight>(TRight right)
=> new(right);
/// <summary>
/// 将Either.Left<TLeft>隐式转为Either<TLeft, TRight>
/// </summary>
/// <param name="left"></param>
public static implicit operator Either<TLeft, TRight>(Left<TLeft> left)
=> new(left.Value);
/// <summary>
/// 将Either.Right<TRight>隐式转为Either<TLeft, TRight>
/// </summary>
/// <param name="right"></param>
public static implicit operator Either<TLeft, TRight>(Right<TRight> right)
=> new(right.Value);
public TRRight Match<TRRight>(Func<TLeft, TRRight> Left, Func<TRight, TRRight> Right)
=> _isLeft ? Left(this.Left!) : Right(this.Right!);
public override string ToString()
=> Match(l => $"Left({l})", r => $"Right({r})");
}
public readonly struct Left<TLeft>
{
internal TLeft Value { get; }
internal Left(TLeft value)
=> Value = value;
public override string ToString()
=> $"Left({Value})";
}
public readonly struct Right<TRight>
{
internal TRight Value { get; }
internal Right(TRight value)
=> Value = value;
public override string ToString()
=> $"Right({Value})";
public Right<TRRight> Map<TLeft, TRRight>(Func<TRight, TRRight> mapping)
=> Either.Right(mapping(Value));
public Either<TLeft, TRRight> Bind<TLeft, TRRight>(Func<TRight, Either<TLeft, TRRight>> binding)
=> binding(Value);
}

View File

@ -0,0 +1,29 @@
using Sanchime.Functional.Core.Products;
namespace Sanchime.Functional.Core.Extensions;
public static class ActionExtension
{
/// <summary>
/// 将Action转换成返回为Unit的Func
/// </summary>
/// <param name="action"></param>
/// <returns></returns>
public static Func<Unit> ToFunc(this Action action)
=> () => { action(); return Unit.Value; };
public static Func<T, Unit> ToFunc<T>(this Action<T> action)
=> (t) => { action(t); return Unit.Value; };
public static Func<T1, T2, Unit> ToFunc<T1, T2>(this Action<T1, T2> action)
=> (t1, t2) => { action(t1, t2); return Unit.Value; };
public static Func<Task<Unit>> ToFunc(this Func<Task> func)
=> async () => { await func(); return Unit.Value; };
public static Func<T, Task<Unit>> ToFunc<T>(this Func<T, Task> func)
=> async (t) => { await func(t); return Unit.Value; };
public static Func<T1, T2, Task<Unit>> ToFunc<T1, T2>(this Func<T1, T2, Task> func)
=> async (t1, t2) => { await func(t1, t2); return Unit.Value; };
}

View File

@ -0,0 +1,35 @@
namespace Sanchime.Functional.Core.Extensions;
/// <summary>
/// 该类是对Func委托实现柯里化的扩展
/// </summary>
public static class CurryingExtension
{
public static Func<T1, Func<T2, R>> Curry<T1, T2, R>(this Func<T1, T2, R> func)
=> t1 => t2 => func(t1, t2);
public static Func<T1, Func<T2, Func<T3, R>>> Curry<T1, T2, T3, R>(this Func<T1, T2, T3, R> func)
=> t1 => t2 => t3 => func(t1, t2, t3);
public static Func<T1, Func<T2, T3, R>> CurryFirst<T1, T2, T3, R>(this Func<T1, T2, T3, R> func)
=> t1 => (t2, t3) => func(t1, t2, t3);
public static Func<T1, Func<T2, T3, T4, R>> CurryFirst<T1, T2, T3, T4, R>(this Func<T1, T2, T3, T4, R> func)
=> t1 => (t2, t3, t4) => func(t1, t2, t3, t4);
public static Func<T1, Func<T2, T3, T4, T5, R>> CurryFirst<T1, T2, T3, T4, T5, R>(this Func<T1, T2, T3, T4, T5, R> func)
=> t1 => (t2, t3, t4, t5) => func(t1, t2, t3, t4, t5);
public static Func<T1, Func<T2, T3, T4, T5, T6, R>> CurryFirst<T1, T2, T3, T4, T5, T6, R>(this Func<T1, T2, T3, T4, T5, T6, R> func)
=> t1 => (t2, t3, t4, t5, t6) => func(t1, t2, t3, t4, t5, t6);
public static Func<T1, Func<T2, T3, T4, T5, T6, T7, R>> CurryFirst<T1, T2, T3, T4, T5, T6, T7, R>(this Func<T1, T2, T3, T4, T5, T6, T7, R> func)
=> t1 => (t2, t3, t4, t5, t6, t7) => func(t1, t2, t3, t4, t5, t6, t7);
public static Func<T1, Func<T2, T3, T4, T5, T6, T7, T8, R>> CurryFirst<T1, T2, T3, T4, T5, T6, T7, T8, R>(this Func<T1, T2, T3, T4, T5, T6, T7, T8, R> func)
=> t1 => (t2, t3, t4, t5, t6, t7, t8) => func(t1, t2, t3, t4, t5, t6, t7, t8);
public static Func<T1, Func<T2, T3, T4, T5, T6, T7, T8, T9, R>> CurryFirst<T1, T2, T3, T4, T5, T6, T7, T8, T9, R>(this Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, R> func)
=> t1 => (t2, t3, t4, t5, t6, t7, t8, t9) => func(t1, t2, t3, t4, t5, t6, t7, t8, t9);
}

View File

@ -0,0 +1,67 @@
using Sanchime.Functional.Core.Products;
using Sanchime.Functional.Core.Eithers;
namespace Sanchime.Functional.Core.Extensions;
public static class EitherExtension
{
public static Unit Match<L, R>(this Either<L, R> either, Action<L> Left, Action<R> Right)
=> either.Match(Left.ToFunc(), Right.ToFunc());
#region
public static Either<L, RR> Map<L, R, RR>(this Either<L, R> either, Func<R, RR> mapping)
=> either.Match<Either<L, RR>>(l => Either.Left(l), r => Either.Right(mapping(r)));
public static Either<LL, RR> Map<L, LL, R, RR>(this Either<L, R> either, Func<L, LL> Left, Func<R, RR> Right)
=> either.Match<Either<LL, RR>>(l => Either.Left(Left(l)), r => Either.Right(Right(r)));
#endregion
#region
public static Either<L, RR> Bind<L, R, RR>(this Either<L, R> either, Func<R, Either<L, RR>> binding)
=> either.Match(l => Either.Left(l), r => binding(r));
#endregion
#region
public static Either<L, RR> Apply<L, R, RR>(this Either<L, Func<R, RR>> either, Either<L, R> param)
=> either.Match(
Left: error => Either.Left(error),
Right: func => param.Match<Either<L, RR>>(
Left: error => Either.Left(error),
Right: right => Either.Right(func(right))));
public static Either<L, Func<T2, R>> Apply<L, T1, T2, R>(this Either<L, Func<T1, T2, R>> either, Either<L, T1> param)
=> Apply(either.Map(CurryingExtension.Curry), param);
public static Either<L, Func<T2, T3, R>> Apply<L, T1, T2, T3, R>(this Either<L, Func<T1, T2, T3, R>> either, Either<L, T1> param)
=> Apply(either.Map(CurryingExtension.CurryFirst), param);
public static Either<L, Func<T2, T3, T4, R>> Apply<L, T1, T2, T3, T4, R>(this Either<L, Func<T1, T2, T3, T4, R>> either, Either<L, T1> param)
=> Apply(either.Map(CurryingExtension.CurryFirst), param);
public static Either<L, Func<T2, T3, T4, T5, R>> Apply<L, T1, T2, T3, T4, T5, R>(this Either<L, Func<T1, T2, T3, T4, T5, R>> either, Either<L, T1> param)
=> Apply(either.Map(CurryingExtension.CurryFirst), param);
public static Either<L, Func<T2, T3, T4, T5, T6, R>> Apply<L, T1, T2, T3, T4, T5, T6, R>(this Either<L, Func<T1, T2, T3, T4, T5, T6, R>> either, Either<L, T1> param)
=> Apply(either.Map(CurryingExtension.CurryFirst), param);
public static Either<L, Func<T2, T3, T4, T5, T6, T7, R>> Apply<L, T1, T2, T3, T4, T5, T6, T7, R>(this Either<L, Func<T1, T2, T3, T4, T5, T6, T7, R>> either, Either<L, T1> param)
=> Apply(either.Map(CurryingExtension.CurryFirst), param);
public static Either<L, Func<T2, T3, T4, T5, T6, T7, T8, R>> Apply<L, T1, T2, T3, T4, T5, T6, T7, T8, R>(this Either<L, Func<T1, T2, T3, T4, T5, T6, T7, T8, R>> either, Either<L, T1> param)
=> Apply(either.Map(CurryingExtension.CurryFirst), param);
public static Either<L, Func<T2, T3, T4, T5, T6, T7, T8, T9, R>> Apply<L, T1, T2, T3, T4, T5, T6, T7, T8, T9, R>(this Either<L, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, R>> either, Either<L, T1> param)
=> Apply(either.Map(CurryingExtension.CurryFirst), param);
#endregion
public static Either<L, Unit> ForEach<L, R>(this Either<L, R> either, Action<R> action)
=> either.Map(action.ToFunc());
}

View File

@ -0,0 +1,52 @@
using System.Collections.Immutable;
using Sanchime.Functional.Core.Options;
using Sanchime.Functional.Core.Products;
namespace Sanchime.Functional.Core.Extensions;
/// <summary>
/// 序列扩展类
/// </summary>
public static class IEnumerableExtension
{
public static Func<T, IEnumerable<T>> Return<T>() => t => List(t);
public static Option<T> Head<T>(this IEnumerable<T> list)
{
if (list is null)
{
return Option.None;
}
var enumerator = list.GetEnumerator();
return enumerator.MoveNext() ? Option.Some(enumerator.Current) : Option.None;
}
public static R Match<T, R>(this IEnumerable<T> list, Func<R> Empty, Func<T, IEnumerable<T>, R> Otherwise)
=> list.Head().Match(Empty, (head) => Otherwise(head, list.Skip(1)));
public static IEnumerable<R> Map<T, R>(this IEnumerable<T> list, Func<T, R> func)
=> list.Select(func);
/// <summary>
/// 给集合内每个元素执行一个无返回值函数
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="source"></param>
/// <param name="action"></param>
/// <returns></returns>
public static IEnumerable<Unit> ForEach<T>(this IEnumerable<T> source, Action<T> action)
=> source.Map(action.ToFunc()).ToImmutableList();
public static IEnumerable<R> Bind<T, R>(this IEnumerable<T> list, Func<T, IEnumerable<R>> func)
=> list.SelectMany(func);
public static IEnumerable<R> Bind<T, R>(this IEnumerable<T> list, Func<T, Option<R>> func)
=> list.Bind(t => func(t).AsEnumerable());
private static IEnumerable<T> List<T>(T t)
{
throw new NotImplementedException();
}
}

View File

@ -0,0 +1,68 @@
using Sanchime.Functional.Core.Options;
using Sanchime.Functional.Core.Products;
namespace Sanchime.Functional.Core.Extensions;
public static class OptionExtension
{
public static Unit Match<T>(this Option<T> option, Action None, Action<T> Some)
=> option.Match(None.ToFunc(), Some.ToFunc());
#region :
public static Option<R> Map<T, R>(this None _, Func<T, R> mapping)
=> Option.None;
public static Option<R> Map<T, R>(this Some<T> some, Func<T, R> mapping)
=> Option.Some(mapping(some.Value));
public static Option<R> Map<T, R>(this Option<T> option, Func<T, R> mapping)
=> option.Match(() => Option.None, (val) => Option.Some(mapping(val)));
public static Option<Func<T2, R>> Map<T1, T2, R>(this Option<T1> option, Func<T1, T2, R> mapping)
=> option.Map(mapping.Curry());
public static Option<Func<T2, T3, R>> Map<T1, T2, T3, R>(this Option<T1> option, Func<T1, T2, T3, R> mapping)
=> option.Map(mapping.CurryFirst());
#endregion
#region :
/// <summary>
/// Return自然变换: 将上下文无关的值导入至上下文有关的世界
/// </summary>
/// <param name="value"></param>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
public static Option<T> Return<T>(T value)
=> value is null ? Option.None : Option.Some(value);
public static Option<R> Bind<T, R>(this Option<T> option, Func<T, Option<R>> binding)
=> option.Match(() => new Option<R>(), binding);
public static IEnumerable<R> Bind<T1, T2, R>(this Option<T1> option, Func<T1, IEnumerable<R>> binding)
=> option.AsEnumerable().Bind(binding);
#endregion
#region
/// <summary>
/// 幺
/// </summary>
/// <param name="option"></param>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
public static Option<T> Identity<T>(this Option<T> option) => option;
public static Option<R> Apply<T, R>(this Option<T> option, Func<Option<T>, R> apply, Option<T> value)
=> option.Match(
None: () => Option.None,
Some: (func) => value.Match(
None: () => Option.None,
Some: (val) => Option.Some(apply(value))));
#endregion
}

View File

@ -0,0 +1,16 @@
namespace Sanchime.Functional.Core.Extensions;
/// <summary>
/// 该类为管道扩展类
/// </summary>
public static class PiperExtension
{
public static Func<T, T> Tap<T>(Action<T> action)
=> x => { action(x); return x; };
public static R Pipe<T, R>(this T @this, Func<T, R> func)
=> func(@this);
public static T Pipe<T>(this T input, Action<T> func)
=> Tap(func)(input);
}

View File

@ -0,0 +1,10 @@
namespace Sanchime.Functional.Core.Extensions;
public static class TupleExtension
{
public static R Match<T1, T2, R>(this Tuple<T1, T2> @this, Func<T1, T2, R> func)
=> func(@this.Item1, @this.Item2);
public static R Match<T1, T2, R>(this ValueTuple<T1, T2> @this, Func<T1, T2, R> func)
=> func(@this.Item1, @this.Item2);
}

View File

@ -0,0 +1,101 @@
using Sanchime.Functional.Core.Products;
namespace Sanchime.Functional.Core.Options;
/// <summary>
/// <see cref="Option"/>的<see cref="None"/>状态
/// </summary>
public readonly struct None
{
internal static readonly None Default = new();
}
/// <summary>
/// <see cref="Option"/>的<see cref="Some"/>状态
/// </summary>
/// <typeparam name="TValue"></typeparam>
public readonly struct Some<TValue>
{
internal TValue Value { get; }
internal Some(TValue value) => Value = value ?? throw new ArgumentNullException(nameof(value), "不能在Some状态中包装null值, 应该使用None");
}
public static class Option
{
public static None None => None.Default;
public static Option<TValue> Some<TValue>(TValue value) => new Some<TValue>(value);
}
public readonly struct Option<TValue> : IEquatable<None>, IEquatable<Option<TValue>>
{
private readonly TValue _value;
private readonly bool _isSome;
private bool _isNone => !_isSome;
private Option(TValue value)
=> (_isSome, _value) = (true, value ?? throw new ArgumentNullException(nameof(value)));
/// <summary>
/// 将<see cref="None"/>转换为<see cref="Option"/>
/// </summary>
/// <param name="_"></param>
public static implicit operator Option<TValue>(None _)
=> new();
/// <summary>
/// 将<see cref="Some"/>转换为<see cref="Option"/>
/// </summary>
/// <param name="some"></param>
public static implicit operator Option<TValue>(Some<TValue> some)
=> new(some.Value);
/// <summary>
/// 将常规值提升至<see cref="Option"/>
/// </summary>
/// <param name="value"></param>
public static implicit operator Option<TValue>(TValue value)
=> value is null ? Option.None : Option.Some(value);
internal bool IsSome() => this.Match(() => false, (_) => true);
internal TValue ValueUnsafe => this.Match(() => throw new InvalidOperationException(), val => val);
/// <summary>
/// 转换为序列
/// </summary>
/// <returns></returns>
public IEnumerable<TValue> AsEnumerable()
{
if (_isSome) yield return _value;
}
/// <summary>
/// 接收两个函数,根据<see cref="Option"/>的状态进行求值
/// </summary>
/// <typeparam name="TResult"></typeparam>
/// <param name="None">None状态</param>
/// <param name="Some">Some状态</param>
/// <returns></returns>
public TResult Match<TResult>(Func<TResult> None, Func<TValue, TResult> Some)
=> _isSome ? Some(_value) : None();
public bool Equals(Option<TValue> other)
=> this._isSome == other._isSome
&& (this._isNone || this._value!.Equals(other._value));
public bool Equals(None _) => _isNone;
public static bool operator ==(Option<TValue> option, Option<TValue> other) => option.Equals(other);
public static bool operator !=(Option<TValue> option, Option<TValue> other) => !(option == other);
public override string ToString() => _isSome ? $"Some({_value})" : "None";
public override bool Equals(object? _) => _isSome;
public override int GetHashCode()
=> _isNone ? 0 : _value!.GetHashCode();
}

View File

@ -0,0 +1,15 @@
namespace Sanchime.Functional.Core.Products;
public sealed class Unit
{
private static readonly Unit _unique = new();
public static Unit Value => _unique;
private Unit() { }
static Unit() { }
public override int GetHashCode() => 0;
public override bool Equals(object? obj) => this == obj;
public override string ToString() => "()";
}

View File

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,23 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v7.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v7.0": {
"Sanchime.Functional/1.0.0": {
"runtime": {
"Sanchime.Functional.dll": {}
}
}
}
},
"libraries": {
"Sanchime.Functional/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}

View File

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v7.0", FrameworkDisplayName = "")]

View File

@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Sanchime.Functional")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("Sanchime.Functional")]
[assembly: System.Reflection.AssemblyTitleAttribute("Sanchime.Functional")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// 由 MSBuild WriteCodeFragment 类生成。

View File

@ -0,0 +1 @@
1132520a32de11ff302b7fe56da971f09e88fb78

View File

@ -0,0 +1,10 @@
is_global = true
build_property.TargetFramework = net7.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Sanchime.Functional
build_property.ProjectDir = /home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Functional/

View File

@ -0,0 +1,8 @@
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;

View File

@ -0,0 +1 @@
8413862575563783b7af3a2ce6adc70e843ad403

View File

@ -0,0 +1,12 @@
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Functional/bin/Debug/net7.0/Sanchime.Functional.deps.json
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Functional/bin/Debug/net7.0/Sanchime.Functional.dll
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Functional/bin/Debug/net7.0/Sanchime.Functional.pdb
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Functional/obj/Debug/net7.0/Sanchime.Functional.csproj.AssemblyReference.cache
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Functional/obj/Debug/net7.0/Sanchime.Functional.GeneratedMSBuildEditorConfig.editorconfig
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Functional/obj/Debug/net7.0/Sanchime.Functional.AssemblyInfoInputs.cache
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Functional/obj/Debug/net7.0/Sanchime.Functional.AssemblyInfo.cs
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Functional/obj/Debug/net7.0/Sanchime.Functional.csproj.CoreCompileInputs.cache
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Functional/obj/Debug/net7.0/Sanchime.Functional.dll
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Functional/obj/Debug/net7.0/refint/Sanchime.Functional.dll
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Functional/obj/Debug/net7.0/Sanchime.Functional.pdb
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Functional/obj/Debug/net7.0/ref/Sanchime.Functional.dll

View File

@ -0,0 +1,60 @@
{
"format": 1,
"restore": {
"/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Functional/Sanchime.Functional.csproj": {}
},
"projects": {
"/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Functional/Sanchime.Functional.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Functional/Sanchime.Functional.csproj",
"projectName": "Sanchime.Functional",
"projectPath": "/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Functional/Sanchime.Functional.csproj",
"packagesPath": "/home/sanchime/.nuget/packages/",
"outputPath": "/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Functional/obj/",
"projectStyle": "PackageReference",
"configFilePaths": [
"/home/sanchime/.nuget/NuGet/NuGet.Config"
],
"originalTargetFrameworks": [
"net7.0"
],
"sources": {
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net7.0": {
"targetAlias": "net7.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net7.0": {
"targetAlias": "net7.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "/home/sanchime/dotnet/sdk/7.0.100-preview.3.22179.4/RuntimeIdentifierGraph.json"
}
}
}
}
}

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(ExcludeRestorePackageImports)' != 'true'">
<RestoreSuccess Condition="'$(RestoreSuccess)' == ''">True</RestoreSuccess>
<RestoreTool Condition="'$(RestoreTool)' == ''">NuGet</RestoreTool>
<ProjectAssetsFile Condition="'$(ProjectAssetsFile)' == ''">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition="'$(NuGetPackageRoot)' == ''">/home/sanchime/.nuget/packages/</NuGetPackageRoot>
<NuGetPackageFolders Condition="'$(NuGetPackageFolders)' == ''">/home/sanchime/.nuget/packages/</NuGetPackageFolders>
<NuGetProjectStyle Condition="'$(NuGetProjectStyle)' == ''">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition="'$(NuGetToolVersion)' == ''">6.2.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition="'$(ExcludeRestorePackageImports)' != 'true'">
<SourceRoot Include="/home/sanchime/.nuget/packages/" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />

View File

@ -0,0 +1,65 @@
{
"version": 3,
"targets": {
"net7.0": {}
},
"libraries": {},
"projectFileDependencyGroups": {
"net7.0": []
},
"packageFolders": {
"/home/sanchime/.nuget/packages/": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Functional/Sanchime.Functional.csproj",
"projectName": "Sanchime.Functional",
"projectPath": "/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Functional/Sanchime.Functional.csproj",
"packagesPath": "/home/sanchime/.nuget/packages/",
"outputPath": "/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Functional/obj/",
"projectStyle": "PackageReference",
"configFilePaths": [
"/home/sanchime/.nuget/NuGet/NuGet.Config"
],
"originalTargetFrameworks": [
"net7.0"
],
"sources": {
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net7.0": {
"targetAlias": "net7.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net7.0": {
"targetAlias": "net7.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "/home/sanchime/dotnet/sdk/7.0.100-preview.3.22179.4/RuntimeIdentifierGraph.json"
}
}
}
}

View File

@ -0,0 +1,8 @@
{
"version": 2,
"dgSpecHash": "SFlPh821qi4GkLKqdQvlF3w70bJfiHdxPTcWjQz6sHNJrETehv6TShnFcPyYahMOhHW73n97cu5NcnOrJNHiSw==",
"success": true,
"projectFilePath": "/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Functional/Sanchime.Functional.csproj",
"expectedPackageFiles": [],
"logs": []
}

2
Sanchime.Test/Program.cs Normal file
View File

@ -0,0 +1,2 @@
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World of csharp!");

View File

@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

Binary file not shown.

View File

@ -0,0 +1,23 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v7.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v7.0": {
"Sanchime.Test/1.0.0": {
"runtime": {
"Sanchime.Test.dll": {}
}
}
}
},
"libraries": {
"Sanchime.Test/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,9 @@
{
"runtimeOptions": {
"tfm": "net7.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "7.0.0-preview.3.22175.4"
}
}
}

View File

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v7.0", FrameworkDisplayName = "")]

View File

@ -0,0 +1,23 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Sanchime.Test")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("Sanchime.Test")]
[assembly: System.Reflection.AssemblyTitleAttribute("Sanchime.Test")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generated by the MSBuild WriteCodeFragment class.

View File

@ -0,0 +1 @@
73960f945a70a6a9d9c002c9badd09c9c5bbdaaa

View File

@ -0,0 +1,10 @@
is_global = true
build_property.TargetFramework = net7.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Sanchime.Test
build_property.ProjectDir = /home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Test/

View File

@ -0,0 +1,8 @@
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;

View File

@ -0,0 +1 @@
e44050b4489f46bba21644af8321e43704d64621

View File

@ -0,0 +1,15 @@
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Test/obj/Debug/net7.0/Sanchime.Test.csproj.AssemblyReference.cache
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Test/obj/Debug/net7.0/Sanchime.Test.GeneratedMSBuildEditorConfig.editorconfig
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Test/obj/Debug/net7.0/Sanchime.Test.AssemblyInfoInputs.cache
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Test/obj/Debug/net7.0/Sanchime.Test.AssemblyInfo.cs
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Test/obj/Debug/net7.0/Sanchime.Test.csproj.CoreCompileInputs.cache
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Test/bin/Debug/net7.0/Sanchime.Test
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Test/bin/Debug/net7.0/Sanchime.Test.deps.json
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Test/bin/Debug/net7.0/Sanchime.Test.runtimeconfig.json
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Test/bin/Debug/net7.0/Sanchime.Test.dll
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Test/bin/Debug/net7.0/Sanchime.Test.pdb
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Test/obj/Debug/net7.0/Sanchime.Test.dll
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Test/obj/Debug/net7.0/refint/Sanchime.Test.dll
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Test/obj/Debug/net7.0/Sanchime.Test.pdb
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Test/obj/Debug/net7.0/Sanchime.Test.genruntimeconfig.cache
/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Test/obj/Debug/net7.0/ref/Sanchime.Test.dll

Binary file not shown.

View File

@ -0,0 +1 @@
33a4f258a1f2d4d1d0e58651d07533895907fd92

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,60 @@
{
"format": 1,
"restore": {
"/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Test/Sanchime.Test.csproj": {}
},
"projects": {
"/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Test/Sanchime.Test.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Test/Sanchime.Test.csproj",
"projectName": "Sanchime.Test",
"projectPath": "/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Test/Sanchime.Test.csproj",
"packagesPath": "/home/sanchime/.nuget/packages/",
"outputPath": "/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Test/obj/",
"projectStyle": "PackageReference",
"configFilePaths": [
"/home/sanchime/.nuget/NuGet/NuGet.Config"
],
"originalTargetFrameworks": [
"net7.0"
],
"sources": {
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net7.0": {
"targetAlias": "net7.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net7.0": {
"targetAlias": "net7.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "/home/sanchime/dotnet/sdk/7.0.100-preview.3.22179.4/RuntimeIdentifierGraph.json"
}
}
}
}
}

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(ExcludeRestorePackageImports)' != 'true'">
<RestoreSuccess Condition="'$(RestoreSuccess)' == ''">True</RestoreSuccess>
<RestoreTool Condition="'$(RestoreTool)' == ''">NuGet</RestoreTool>
<ProjectAssetsFile Condition="'$(ProjectAssetsFile)' == ''">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition="'$(NuGetPackageRoot)' == ''">/home/sanchime/.nuget/packages/</NuGetPackageRoot>
<NuGetPackageFolders Condition="'$(NuGetPackageFolders)' == ''">/home/sanchime/.nuget/packages/</NuGetPackageFolders>
<NuGetProjectStyle Condition="'$(NuGetProjectStyle)' == ''">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition="'$(NuGetToolVersion)' == ''">6.2.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition="'$(ExcludeRestorePackageImports)' != 'true'">
<SourceRoot Include="/home/sanchime/.nuget/packages/" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />

View File

@ -0,0 +1,65 @@
{
"version": 3,
"targets": {
"net7.0": {}
},
"libraries": {},
"projectFileDependencyGroups": {
"net7.0": []
},
"packageFolders": {
"/home/sanchime/.nuget/packages/": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Test/Sanchime.Test.csproj",
"projectName": "Sanchime.Test",
"projectPath": "/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Test/Sanchime.Test.csproj",
"packagesPath": "/home/sanchime/.nuget/packages/",
"outputPath": "/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Test/obj/",
"projectStyle": "PackageReference",
"configFilePaths": [
"/home/sanchime/.nuget/NuGet/NuGet.Config"
],
"originalTargetFrameworks": [
"net7.0"
],
"sources": {
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net7.0": {
"targetAlias": "net7.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net7.0": {
"targetAlias": "net7.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "/home/sanchime/dotnet/sdk/7.0.100-preview.3.22179.4/RuntimeIdentifierGraph.json"
}
}
}
}

View File

@ -0,0 +1,8 @@
{
"version": 2,
"dgSpecHash": "hVqrEND44Ni0Uq1FZGL0O3sgJV3YmZOJl7DfdliEudDkWFYX9hnjF3tXqhakgknR/DATzN8uFWrT5340iUMlig==",
"success": true,
"projectFilePath": "/home/sanchime/桌面/Program/C#/Sanchime/Sanchime.Test/Sanchime.Test.csproj",
"expectedPackageFiles": [],
"logs": []
}

28
Sanchime.sln Normal file
View File

@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30114.105
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sanchime.Test", "Sanchime.Test\Sanchime.Test.csproj", "{852F212D-00AC-45B8-84FB-A97E0E711317}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sanchime.Functional", "Sanchime.Functional\Sanchime.Functional.csproj", "{DF48AFE2-CD1B-4BCE-83EF-DA8BDA104069}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{852F212D-00AC-45B8-84FB-A97E0E711317}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{852F212D-00AC-45B8-84FB-A97E0E711317}.Debug|Any CPU.Build.0 = Debug|Any CPU
{852F212D-00AC-45B8-84FB-A97E0E711317}.Release|Any CPU.ActiveCfg = Release|Any CPU
{852F212D-00AC-45B8-84FB-A97E0E711317}.Release|Any CPU.Build.0 = Release|Any CPU
{DF48AFE2-CD1B-4BCE-83EF-DA8BDA104069}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DF48AFE2-CD1B-4BCE-83EF-DA8BDA104069}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DF48AFE2-CD1B-4BCE-83EF-DA8BDA104069}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DF48AFE2-CD1B-4BCE-83EF-DA8BDA104069}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal