Exemplo n.º 1
0
        private IEnumerable <string> GetMembers(ProjectedAtomRoot atom)
        {
            var members = atom.Members.Where(mem => !mem.Member.HasFlag(MemberFlags.Hidden));

            foreach (var member in members)
            {
                string name = new CSharpMemberNameFinder(member).MemberName();
                string type = GetMemberType(member.Member);

                if (member.Member.HasFlag(MemberFlags.TemporalTracking))
                {
                    yield return($"public {type} {name} {{ get; private set; }}");
                }
                else
                {
                    yield return($"public {type} {name} {{ get; set; }}");
                }

                if (member.Member.HasReference &&
                    member.Member.Reference.TargetMember.Atom.IsLookup)
                {
                    yield return($"private {type} {name}Id {{ set {{ {name} = value; }} }}");
                }
            }
        }
Exemplo n.º 2
0
        private IEnumerable<string> GetMembers(ProjectedAtomRoot atom)
        {
            var members = atom.Members.Where(mem => !mem.Member.HasFlag(MemberFlags.Hidden));

            foreach (var member in members)
            {
                string name = new CSharpMemberNameFinder(member).MemberName();
                string type = GetMemberType(member.Member);

                if (member.Member.HasFlag(MemberFlags.TemporalTracking))
                {
                    yield return $"public {type} {name} {{ get; private set; }}";
                }
                else
                {
                    yield return $"public {type} {name} {{ get; set; }}";
                }

                if (member.Member.HasReference &&
                    member.Member.Reference.TargetMember.Atom.IsLookup)
                {
                    yield return $"private {type} {name}Id {{ set {{ {name} = value; }} }}";
                }
            }
        }
        private string GetUpdateFields(RepositoryMemberInfo repositoryMembmerInfo, string className)
        {
            var queryParams = repositoryMembmerInfo.Info.InputParams.Select(
                memberInfo =>
            {
                var parameterName = memberInfo.Name;
                if (memberInfo.HasReference && memberInfo.Reference.IsReferenceToHiddenPrimaryKey)
                {
                    parameterName = memberInfo.Reference.TargetAtomAlternateKey.Name;
                }
                string memberName = new CSharpMemberNameFinder(memberInfo).MemberName();
                return($"{parameterName} = {StrongTypeCastingType(memberInfo)}({className}.{memberName})");
            });

            return(string.Join("," + Environment.NewLine, queryParams)
                   .Trim());
        }
Exemplo n.º 4
0
        private string GetUpdateFields(RepositoryMemberInfo repositoryMembmerInfo, string className)
        {
            var queryParams = repositoryMembmerInfo.Info.InputParams.Select(
                memberInfo =>
                {
                    var parameterName = memberInfo.Name;
                    if (memberInfo.HasReference && memberInfo.Reference.IsReferenceToHiddenPrimaryKey)
                    {
                        parameterName = memberInfo.Reference.TargetAtomAlternateKey.Name;
                    }
                    string memberName = new CSharpMemberNameFinder(memberInfo).MemberName();
                    return $"{parameterName} = {StrongTypeCastingType(memberInfo)}({className}.{memberName})";
                });

            return string.Join("," + Environment.NewLine, queryParams)
                         .Trim();
        }