Neco/EzTax/TaxJurisdiction.cs
/// <summary>Calculates tax on User U with income I in this jurisdiction</summary>
/// <param name="U"></param>
/// <param name="I"></param>
/// <returns></returns>
Calculates tax on User U with income I in this jurisdiction
Calculates tax on User U with income I in this jurisdiction
public (long,TaxBracket) CalculateTax(User U, long I) {
            TaxBracket T = Brackets?.FirstOrDefault(P => P.Type.Equals(U.Type) && I >= P.Start && I < P.End); 
            if(T == null) return (0, null);
            return (Convert.ToInt64(I * T.Rate), T);
        }
public ( long , TaxBracket ) CalculateTax ( User U , long I ) { TaxBracket T = Brackets ? . FirstOrDefault ( P => P . Type . Equals ( U . Type ) && I >= P . Start && I < P . End ) ; if ( T == null ) return ( 0 , null ) ; return ( Convert . ToInt64 ( I * T . Rate ) , T ) ; }
Calculates tax on User U with income I in this jurisdiction
Calculates tax on User U with income I in this jurisdiction
//LOOK AT THIS BEAUTY HOW HAD I NOT USED LINQ BEFORE
None
U
User
None
I
long
None