Exemplo n.º 1
0
        public static MongoDbApp FromApp(App app)
        {
            var id = app.Id;

            var result = new MongoDbApp
            {
                DocId = id,
                Doc   = app,
                Etag  = GenerateEtag()
            };

            if (app.Contributors?.Count > 0)
            {
                result.ContributorIds = app.Contributors.Keys.ToList();
            }

            return(result);
        }
Exemplo n.º 2
0
        public static MongoDbApp FromApp(App app)
        {
            var result = new MongoDbApp
            {
                DocId = app.Id,
                Doc   = app,
                Etag  = GenerateEtag()
            };

            if (app.Contributors?.Count > 0)
            {
                result.ContributorIds = app.Contributors.Keys.ToList();
            }

            if (app.ApiKeys?.Count > 0)
            {
                result.ApiKeys = app.ApiKeys.Keys.ToList();
            }

            result.IsPending = app.Integrations.Values.Any(x => x.Status == IntegrationStatus.Pending);

            return(result);
        }