zoukankan      html  css  js  c++  java
  • FluentInterfaceDemo 草稿或者说笔记

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Collections;

    namespace FluentInterfaceDemo
    {
        class Program
        {
            static void Main(string[] args)
            {

                Fluent fluent = new Fluent();
                fluent.Money = 10000;
                Console.WriteLine(fluent.IsPass(f => f.Money));
                Console.WriteLine(fluent.CalcTax(f => f.Money).Money);

                Console.WriteLine(GetType<Fluent>(fluent));

                Console.Read();
            }


            static string GetType<TSource>(TSource t)
            {
                return t.GetType().ToString();

            }
        }

        class Fluent:IFluent
        {
            public int UserID { get; set; }
            public string Name { get; set; }
            public double Money { get; set; }
        }

        static class FluentExtent
        {
            public static bool IsPass(this IFluent fluent, Func<Fluent, double> func)
            {
                double m = func((Fluent)fluent);
                return double.Parse(m.ToString()) > 0;
            }

            public static Fluent CalcTax(this Fluent fluent, Func<Fluent, double> func)
            {
                fluent.Money = func(fluent) * 0.35;
                return fluent;
            }

        }

        class Tax
        {
            public double money { get; set; }
            public static double GetTax()
            {
                return 100;
            }
        }

        interface IFluent
        {

        }
    }

    参考资料:

    -------------------------------------------------------------------------------------------------------------------------------------------------
    数据库优化
    数据库教程
    数据库实战经验分享博客

    百度云下载

    评测


  • 相关阅读:
    uva-321-暴力枚举-隐式图搜索
    uva-704-暴力枚举-双向bfs
    整数的无符号编码和有符号编码
    HDU 5793
    HDU 5730
    HDU 5740
    HDU 5768
    HDU 1194
    HDU 1086
    HDU 5145
  • 原文地址:https://www.cnblogs.com/longle/p/2915630.html
Copyright © 2011-2022 走看看