Ejemplo n.º 1
0
        private static async Task <Stream> RewriteRequest(IVersionMigrationHelper migrationHelper)
        {
            var json = JsonConvert.SerializeObject(migrationHelper.GetRequestBody <object>());

            var requestContent = new StringContent(json, Encoding.UTF8, "application/json");

            var stream = await requestContent.ReadAsStreamAsync().ConfigureAwait(false);

            return(stream);
        }
        public void Up(IVersionMigrationHelper migrationHelper)
        {
            if (ShouldApply(migrationHelper.GetHttpContext()))
            {
                var user = migrationHelper.GetRequestBody <dynamic>();

                if (user.userId == null)
                {
                    user.userId = user.id;
                }

                migrationHelper.SetRequestBody(user);
            }
        }