CachedWorld.cs 635 B

1234567891011121314151617
  1. // Copyright (c) .NET Foundation. All rights reserved.
  2. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
  3. using System.Runtime.InteropServices;
  4. namespace Benchmarks.Data
  5. {
  6. public class CachedWorld
  7. {
  8. public int id { get; set; }
  9. public int randomNumber { get; set; }
  10. public static implicit operator World(CachedWorld world) => new World { id = world.id, randomNumber = world.randomNumber };
  11. public static implicit operator CachedWorld(World world) => new CachedWorld { id = world.id, randomNumber = world.randomNumber };
  12. }
  13. }